Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Mathics-Django (macos)
name: Mathics3-django (MacOS)

on:
push:
Expand All @@ -20,9 +20,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install OS dependencies
run: |
brew install llvm nodejs npm tesseract
brew install llvm@14 nodejs npm tesseract
python -m pip install --upgrade pip
LLVM_CONFIG=/usr/local/Cellar/llvm@11/11.1.0/bin/llvm-config pip install llvmlite
- name: Install Python dependencies
run: |
# Can adjust when next Mathics3 is released
Expand All @@ -39,7 +38,9 @@ jobs:
npm install
- name: Install Mathics3 Django
run: |
pip install -e .[full]
# We will do full after release of the various Mathics3 Modules
# pip install -e .[full]
pip install -e .
make develop
- name: Test Mathics3 Django
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Mathics-Django (ubuntu)
name: Mathics3-django (ubuntu)

on:
push:
Expand Down Expand Up @@ -39,7 +39,9 @@ jobs:
npm install
- name: Install Mathics3 Django
run: |
python -m pip install -e .[full]
# We will do full after release of the various Mathics3 Modules
# python -m pip install -e .[full]
python -m pip install -e .
make develop
- name: Test Mathics3 Django
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Mathics (Windows)
# -*- yaml -*-
name: Mathics3-django (Windows)

on:
push:
Expand Down Expand Up @@ -43,7 +44,9 @@ jobs:
run: |
cp node_modules/\@mathicsorg/mathics-threejs-backend/docs/build.js mathics_django/web/media/js/mathics-threejs-backend/index.js
cp node_modules/\@mathicsorg/mathics-threejs-backend/package.json mathics_django
python -m pip install -e .[full]
# We will do full after release of the various Mathics3 Modules
# python -m pip install -e .[full]
python -m pip install -e .
- name: Test Mathics3 Django
run: |
make pytest gstest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/.python-version
/ChangeLog-spell-corrected
/ChangeLog.orig
/Mathics3_Django.egg-info
/Mathics_Django.egg-info
/node_modules
/package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion mathics_django/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# well as importing into Python. That's why there is no
# space around "=" below.
# fmt: off
__version__="9.0.1.dev0" # noqa
__version__="10.0.0.dev0" # noqa
2 changes: 1 addition & 1 deletion mathics_django/web/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h1>Connection Information</h1>

<p>Mathics3 is a general-purpose computer algebra system.</p>

<p>Copyright (C) 2021-2025 The Mathics3 Team<p><br>
<p>Copyright (C) 2021-2026 The Mathics3 Team<p><br>

This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
Expand Down
2 changes: 1 addition & 1 deletion mathics_django/web/templates/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="welcome">
<p><h1>Welcome to Mathics3 (in Django)!</h1></p>

<p>Copyright (C) 2021-2025 The Mathics3 Team</p><br>
<p>Copyright (C) 2021-2026 The Mathics3 Team</p><br>

This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
Expand Down
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[build-system]
requires = ["setuptools"]

build-backend = "setuptools.build_meta"

[project]
name = "Mathics3-Django"
description = "A Django-based frontend for Mathics3"
dependencies = [
"Django >=3.1",
"Mathics3 >9",
"Mathics_Scanner > 9",
"pygments", # For colorized Python tracebacks
"requests",
"scikit-image; sys_platform == 'darwin'",
]
requires-python = ">=3.10"
readme = "README.rst"
license = "GPL-3.0-or-later"
maintainers = [
{name = "Mathics3 Group"},
]
classifiers = [
"Framework :: Django",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Mathematics",
]
dynamic = ["version"]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-django"
]

full = [
"Mathics3-Module-PyICU",
"Mathics3-Module-nltk",
"Mathics3-Module-networkx",
]


[project.scripts]
Mathics3server = "mathics_django.manage:main"

[project.urls]
Homepage = "https://mathics.org/"

[tool.setuptools.package-data]
include = [
"mathics_django/autoload/*.m",
"mathics_django/doc/*.pcl",
"mathics_django/web/media/css/*.css",
"mathics_django/web/media/img/**/*",
"mathics_django/web/media/fonts/**/*",
"mathics_django/web/media/js/**/*.js",
"mathics_django/web/media/js/mathics-threejs-backend/**/*",
"mathics_django/web/templates/**/*.html",
"mathics_django/web/media/js/mathjax/**/*"
]

[tool.setuptools.dynamic]
version = {attr = "mathics_django.version.__version__"}
206 changes: 5 additions & 201 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,206 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""Setuptools based setup script for the Django front end to Mathics.
from setuptools import find_packages, setup

For the easiest installation just type the following command (you'll probably
need root privileges):

python setup.py install

This will install the library in the default location. For instructions on
how to customize the install procedure read the output of:

python setup.py --help install

In addition, there are some other commands:

python setup.py clean -> will clean all trash (*.pyc and stuff)

To get a full list of available commands, read the output of:

python setup.py --help-commands

Or, if all else fails, feel free to write to the mathics users list at
mathics-users@googlegroups.com and ask for help.
"""

import os.path as osp
import platform
import re
import sys

from setuptools import Command, setup


def get_srcdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)


def read(*rnames):
return open(osp.join(get_srcdir(), *rnames)).read()


# stores __version__ in the current namespace
exec(
compile(
open("mathics_django/version.py").read(), "mathics_django/version.py", "exec"
if __name__ == "__main__":
setup(
packages=find_packages(),
include_package_data=True,
)
)

# Get/set VERSION and long_description from files
long_description = read("README.rst") + "\n"


is_PyPy = platform.python_implementation() == "PyPy" or hasattr(
sys, "pypy_version_info"
)

DEPENDENCY_LINKS = []
INSTALL_REQUIRES = []

if sys.platform == "darwin":
INSTALL_REQUIRES += ["scikit-image"]

# General Requirements
INSTALL_REQUIRES += [
"Mathics-Scanner >2.0",
"Mathics3 >9.1",
"django",
"matplotlib", # For networkx graphs
"networkx >= 3.0",
"pygments", # For colorized Python tracebacks
"requests",
]


def subdirs(root, file="*.*", depth=10):
for k in range(depth):
yield root + "*/" * k + file


class initialize(Command):
"""
Manually create the Django database used by the web notebook
"""

description = "manually create the Django database used by the web notebook"
user_options = [] # distutils complains if this is not here.

def __init__(self, *args):
self.args = args[0] # so we can pass it to other classes
Command.__init__(self, *args)

def initialize_options(self): # distutils wants this
pass

def finalize_options(self): # this too
pass

def run(self):
import os
import subprocess

settings = {}
exec(
compile(
open("mathics_django/settings.py").read(),
"mathics-django/settings.py",
"exec",
),
settings,
)

database_file = settings["DATABASES"]["default"]["NAME"]
print("Creating data directory %s" % settings["DATA_DIR"])
if not osp.exists(settings["DATA_DIR"]):
os.makedirs(settings["DATA_DIR"])
print("Creating database %s" % database_file)
try:
subprocess.check_call(
[sys.executable, "mathics_django/manage.py", "migrate", "--noinput"]
)
print("")
print("Database created successfully.")
except subprocess.CalledProcessError:
print("Error: failed to create database")
sys.exit(1)


mathjax_files = list(subdirs("media/js/mathjax/"))

extra_requires = []
for line in open("requirements-full.txt").read().split("\n"):
if line and not line.startswith("#"):
requires = re.sub(r"([^#]+)(\s*#.*$)?", r"\1", line)
extra_requires.append(requires)

EXTRA_REQUIRES = {"full": extra_requires}

setup(
name="Mathics-Django",
version=__version__,
packages=[
"mathics_django",
"mathics_django.doc",
"mathics_django.web",
"mathics_django.web.controllers",
"mathics_django.web.templatetags",
"mathics_django.web.migrations",
],
install_requires=INSTALL_REQUIRES,
extras_require=EXTRA_REQUIRES,
dependency_links=DEPENDENCY_LINKS,
package_data={
"mathics_django": ["autoload/*.m"],
"mathics_django.doc": ["*.pcl"],
"mathics_django.web": [
"media/css/*.css",
"media/img/*.*",
"media/fonts/*",
"media/img/favicons/*",
"media/js/innerdom/*.js",
"media/js/mathics-threejs-backend/*",
"media/js/prototype/*.js",
"media/js/scriptaculous/*.js",
"media/js/*.js",
"templates/*.html",
"templates/doc/*.html",
]
+ mathjax_files,
},
entry_points={
"console_scripts": [
"mathicsserver = mathics_django.server:main",
],
},
long_description=long_description,
long_description_content_type="text/x-rst",
# don't pack Mathics in egg because of media files, etc.
zip_safe=False,
# metadata for upload to PyPI
maintainer="Mathics3 Group",
maintainer_email="mathics-devel@googlegroups.com",
description="A Django front end for Mathics3.",
license="GPL",
url="https://mathics.org/",
keywords=["Mathematica", "Wolfram", "Interpreter", "Shell", "Math", "CAS"],
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Interpreters",
],
# TODO: could also include long_description, download_url,
)