Skip to content
Merged
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
69 changes: 35 additions & 34 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: mathicsscript (MacOS)
---
name: Mathics3 script (MacOS)

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:
Expand All @@ -14,34 +15,34 @@ jobs:
os: [macOS]
python-version: ['3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
brew install asymptote
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
# We can comment out after next Mathics3-Scanner release
# git clone --depth 1 https://github.com/Mathics3/Mathics3-scanner.git
# cd Mathics3-scanner/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
# We can comment out after next Mathics3-pygments release
# python -m pip install -e git+https://github.com/Mathics3/Mathics3-pygments#egg=Mathics3-pygments
# We can comment out after next mathics-core release
# git clone --depth 1 https://github.com/Mathics3/mathics-core.git
# cd mathics-core/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
- name: Install mathicsscript
run: |
make
- name: Test mathicsscript
run: |
pip3 install -r requirements-dev.txt
make check
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
brew install asymptote
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
# We can comment out after next Mathics3-Scanner release
# git clone --depth 1 https://github.com/Mathics3/Mathics3-scanner.git
# cd Mathics3-scanner/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
# We can comment out after next Mathics3-pygments release
# python -m pip install -e git+https://github.com/Mathics3/Mathics3-pygments#egg=Mathics3-pygments
# We can comment out after next mathics-core release
# git clone --depth 1 https://github.com/Mathics3/mathics-core.git
# cd mathics-core/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
- name: Install Mathics3 script
run: |
make
- name: Test Mathics3 script
run: |
pip3 install -r requirements-dev.txt
make check
71 changes: 36 additions & 35 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: mathicsscript (ubuntu)
---
name: Mathics3 script (ubuntu)

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:
Expand All @@ -13,35 +14,35 @@ jobs:
matrix:
python-version: ['3.13', '3.11', '3.12', '3.14']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev asymptote
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
# We can comment out after next Mathics3-Scanner release
# git clone --depth 1 https://github.com/Mathics3/Mathics3-scanner.git
# cd Mathics3-scanner/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
# We can comment out after next Mathics3-pygments release
# python -m pip install -e git+https://github.com/Mathics3/Mathics3-pygments#egg=Mathics3-pygments
# We can comment out after next mathics-core release
# cd ..
# git clone --depth 1 https://github.com/Mathics3/mathics-core.git
# cd mathics-core/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
- name: Install mathicsscript
run: |
make
- name: Test mathicsscript
run: |
pip3 install pytest
make check
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev asymptote
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
# We can comment out after next Mathics3-Scanner release
# git clone --depth 1 https://github.com/Mathics3/Mathics3-scanner.git
# cd Mathics3-scanner/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
# We can comment out after next Mathics3-pygments release
# python -m pip install -e git+https://github.com/Mathics3/Mathics3-pygments#egg=Mathics3-pygments
# We can comment out after next mathics-core release
# cd ..
# git clone --depth 1 https://github.com/Mathics3/mathics-core.git
# cd mathics-core/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
- name: Install mathicsscript
run: |
make
- name: Test mathicsscript
run: |
pip3 install pytest
make check
69 changes: 35 additions & 34 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: mathicsscript (Windows)
---
name: Mathics3 script (MS Windows)

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:
Expand All @@ -14,34 +15,34 @@ jobs:
os: [windows]
python-version: ['3.12', '3.14']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel setuptools
set LLVM_DIR="C:\Program Files\LLVM"
# We can comment out after next Mathics-Scanner release
# git clone --depth 1 https://github.com/Mathics3/Mathics3-scanner.git
# cd Mathics3-scanner/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
# We can comment out after next Mathics3-pygments release
# python -m pip install -e git+https://github.com/Mathics3/Mathics3-pygments#egg=Mathics3-pygments
# We can comment out after next mathics-core release
# git clone --depth 1 https://github.com/Mathics3/mathics-core.git
# cd mathics-core/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
- name: Install mathicsscript
run: |
make
- name: Test mathicsscript
run: |
pip3 install -r requirements-dev.txt
make check
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel setuptools
set LLVM_DIR="C:\Program Files\LLVM"
# We can comment out after next Mathics-Scanner release
# git clone --depth 1 https://github.com/Mathics3/Mathics3-scanner.git
# cd Mathics3-scanner/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
# We can comment out after next Mathics3-pygments release
# python -m pip install -e git+https://github.com/Mathics3/Mathics3-pygments#egg=Mathics3-pygments
# We can comment out after next mathics-core release
# git clone --depth 1 https://github.com/Mathics3/mathics-core.git
# cd mathics-core/
# pip install --no-build-isolation -e .
# bash -x admin-tools/make-JSON-tables.sh
# cd ..
- name: Install mathicsscript
run: |
make
- name: Test mathicsscript
run: |
pip3 install -r requirements-dev.txt
make check
33 changes: 19 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
---
default_language_version:
python: python
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
stages: [pre-commit]
exclude: ChangeLog-spell-corrected.diff
- id: end-of-file-fixer
exclude: ChangeLog-spell-corrected.diff
stages: [pre-commit]
- id: trailing-whitespace
exclude: ChangeLog-spell-corrected.diff
- repo: https://github.com/psf/black
- id: check-merge-conflict
- id: debug-statements
stages: [pre-commit]
exclude: ChangeLog-spell-corrected.diff
- id: end-of-file-fixer
exclude: ChangeLog-spell-corrected.diff
stages: [pre-commit]
- id: trailing-whitespace
exclude: ChangeLog-spell-corrected.diff
- repo: https://github.com/psf/black
rev: 25.11.0
hooks:
- id: black
language_version: python3
exclude: 'mathicsscript/version.py'
- id: black
language_version: python3
exclude: 'mathicsscript/version.py'
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.0 # Use the latest version
hooks:
- id: check-github-workflows
# - repo: https://github.com/pycqa/flake8
# rev: 3.9.2
# hooks:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build: inputrc
develop: inputrc
$(PIP) install -e .

#: Make distirbution: wheels, eggs, tarball
#: Make distirbution: wheel and tarball
dist:
./admin-tools/make-dist.sh

Expand Down
6 changes: 2 additions & 4 deletions mathicsscript/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import networkx as nx
from mathics.core.atoms import String
from mathics.core.expression import BoxError, Expression
from mathics.core.symbols import Symbol
from mathics.core.systemsymbols import (
SymbolAborted,
Expand All @@ -22,7 +23,6 @@
SymbolInterpretationBox,
SymbolMathMLForm,
SymbolOutputForm,
SymbolPaneBox,
SymbolPlot,
SymbolStandardForm,
SymbolTeXForm,
Expand Down Expand Up @@ -92,8 +92,6 @@ def eval_boxed(result, fn: Callable, obj, **options):
if isinstance(format, dict):
return dict((k, obj.format_output(expr, f)) for k, f in format.items())

from mathics.core.expression import BoxError, Expression

expr_type = expr.get_head_name()
expr_head = expr.get_head()

Expand Down Expand Up @@ -224,7 +222,7 @@ def eval_boxed(result, fn: Callable, obj, **options):
raise ValueError

try:
boxes = result.boxes_to_text(evaluation=obj)
boxes = result.to_text(evaluation=obj)
except BoxError:
boxes = None
if not hasattr(obj, "seen_box_error"):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name = "Mathics3_script"
description = "Command-line interface to Mathics3"
dependencies = [
"Mathics3_Scanner>=10.0.0",
"Mathics3 >= 10.0.0",
"Mathics3 >= 10.0.1",
"click >= 8.0.0",
"colorama",
"columnize",
Expand Down
Loading