diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index cb8ca43..f9b5368 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -24,10 +24,10 @@ jobs: brew install asymptote python3 -m pip install --upgrade pip # Can comment out when next Mathics core and Mathics-scanner are released - git clone https://github.com/Mathics3/mathics-scanner - (cd mathics-scanner && pip install -e . && bash ./admin-tools/make-JSON-tables.sh) - git clone https://github.com/Mathics3/mathics-core - (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh && pip install -e .[full]) + # git clone https://github.com/Mathics3/mathics-scanner + # (cd mathics-scanner && pip install -e . && bash ./admin-tools/make-JSON-tables.sh) + # git clone https://github.com/Mathics3/mathics-core + # (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh && pip install -e .[full]) - name: Install mathicsscript run: | make diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 618f620..58efee8 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.13', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.13', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -23,10 +23,10 @@ jobs: sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev asymptote python3 -m pip install --upgrade pip # We can comment out when next Mathics core and Mathics-scanner are released - git clone https://github.com/Mathics3/mathics-scanner - (cd mathics-scanner && pip install -e . && bash ./admin-tools/make-JSON-tables.sh) - git clone https://github.com/Mathics3/mathics-core - (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh && pip install -e .[full]) + # git clone https://github.com/Mathics3/mathics-scanner + # (cd mathics-scanner && pip install -e . && bash ./admin-tools/make-JSON-tables.sh) + # git clone https://github.com/Mathics3/mathics-core + # (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh && pip install -e .[full]) - name: Install mathicsscript run: | make diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8dd73fe..2327351 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [windows] - python-version: ['3.11', '3.12'] + python-version: ['3.11', '3.13'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -25,11 +25,11 @@ jobs: python3 -m pip install wheel set LLVM_DIR="C:\Program Files\LLVM" # We can comment out when next Mathics core and Mathics-scanner are released - git clone https://github.com/Mathics3/mathics-scanner - bash -c '(cd mathics-scanner && python -m pip install -e . && bash ./admin-tools/make-JSON-tables.sh)' - git clone https://github.com/Mathics3/mathics-core - bash -c '(cd mathics-core && ./admin-tools/make-JSON-tables.sh && python -m pip install -e .)' - python -m pip install -e . + # git clone https://github.com/Mathics3/mathics-scanner + # bash -c '(cd mathics-scanner && python -m pip install -e . && bash ./admin-tools/make-JSON-tables.sh)' + # git clone https://github.com/Mathics3/mathics-core + # bash -c '(cd mathics-core && ./admin-tools/make-JSON-tables.sh && python -m pip install -e .)' + # python -m pip install -e . - name: Install mathicsscript run: | make diff --git a/.gitignore b/.gitignore index 8943575..10ebc57 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ /.tox /.venv*/* /ChangeLog +/ChangeLog-spell-corrected /ChangeLog.orig /ChangeLog.rej /ChangeLog.spell-corrected diff --git a/CHANGES.rst b/CHANGES.rst index b8d9b91..6e861c6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ CHANGES 9.0.0 ----- -Supports Python 3.13. Python 3.8 support dropped. +Supports Python 3.13. Python 3.8 and 3.9 support dropped. Track API changes in Mathics3 Scanner 9.0.0 @@ -12,15 +12,17 @@ Make CLI options more like wolframscript. This is an incompatible change. Single are now accepted. Short option ``-f`` is associated with ``-file`` rather than ``--fullform``; ``-F`` is is now used for Fullform. Option ``--read`` with alias ``-r`` is now ``-code`` and short option `-c`. -Toggling Autobrace using f4 was fixed. -You can cycle now through pygments styles up using f5 (next style) and f6 (previous style). f1 (help) now show function key -bindings in bottom bar. +Toggling Autobrace using function key F4 was fixed; Function key F1 gives some rudimentary help in the bottom bar. +Match "\(" with "\)" in prompt-toolkit mode Bugs ++++ -Fixed #82 +* #82 Work around a bug giving Set:setraw error +* #87 Exception 'Rule' object has no attribute 'to_python' +* #104 Respect environment variable ``NO_COLOR`` +* #105 Pygments-style ``None`` is not disabling pygments style. 8.0.0 @@ -36,6 +38,7 @@ This release tracks the API changes in the Mathics3 Kernel, and to support enhan * Allow 2D rendering from asymptote * Add/update material in README's and screencast +* #85 7.0.0 diff --git a/ChangeLog-spell-corrected.diff b/ChangeLog-spell-corrected.diff index c4e658a..2c08d21 100644 --- a/ChangeLog-spell-corrected.diff +++ b/ChangeLog-spell-corrected.diff @@ -1,35 +1,185 @@ ---- ChangeLog 2024-08-09 19:09:43.824371249 -0400 -+++ ChangeLog-spell-corrected 2024-08-09 19:08:55.526614192 -0400 -@@ -53,7 +53,7 @@ +--- ChangeLog 2025-08-29 05:28:29.545046534 -0400 ++++ ChangeLog-spell-corrected 2025-08-29 05:31:47.748145274 -0400 +@@ -32,7 +32,7 @@ + 2025-07-22 R. Bernstein + + * NEWS.md => CHANGES.rst, mathicsscript/bindkeys.py, +- mathicsscript/termshell_prompt.py: Add f1 help (#101) * WIP - add f1 key * Addd f1 key and sync with release 9.0.0 ++ mathicsscript/termshell_prompt.py: Add f1 key and sync with release 9.0.0 + + 2025-07-22 rocky + +@@ -233,7 +233,7 @@ 2023-02-25 rocky - + * mathicsscript/__main__.py, mathicsscript/asymptote.py, - mathicsscript/fake_psviewer.py, mathicsscript/format.py: Removce + mathicsscript/fake_psviewer.py, mathicsscript/format.py: Remove flake8 things - + 2023-02-25 rocky -@@ -1088,12 +1088,12 @@ +@@ -263,7 +263,7 @@ + + 2022-12-10 rocky + +- * mathicsscript/termshell.py, mathicsscript/termshell_prompt.py: ++ * mathicsscript/termshell.py, mathicsscript/termshell_prompt.py: + black + + 2022-11-28 rocky +@@ -369,7 +369,7 @@ + 2022-02-15 rocky + + * NEWS.md, mathicsscript/bindkeys.py, +- mathicsscript/termshell_gnu.py, mathicsscript/termshell_prompt.py: ++ mathicsscript/termshell_gnu.py, mathicsscript/termshell_prompt.py: + Handle keybindings in GNU Readline + + 2022-02-15 R. Bernstein +@@ -407,7 +407,7 @@ + + 2022-02-06 rocky + +- * mathicsscript/completion.py, mathicsscript/termshell_gnu.py: ++ * mathicsscript/completion.py, mathicsscript/termshell_gnu.py: + Imports in core have changed Specifically where strip_context is located + + 2021-12-19 rocky +@@ -433,7 +433,7 @@ + 2021-09-04 rocky + + * mathicsscript/data/inputrc-no-unicode, +- mathicsscript/data/inputrc-unicode, mathicsscript/termshell_gnu.py: ++ mathicsscript/data/inputrc-unicode, mathicsscript/termshell_gnu.py: + GNU readline was reading inputrc from wrong place Update readline tables. Warning: input-no-unicode is probably wrong + + 2021-09-04 rocky +@@ -595,7 +595,7 @@ + + 2021-06-30 rocky + +- * .pre-commit-config.yaml, mathicsscript/asymptote.py, setup.py: ++ * .pre-commit-config.yaml, mathicsscript/asymptote.py, setup.py: + Start using Asymptote + + 2021-06-30 rocky +@@ -680,7 +680,7 @@ + + 2021-06-15 rocky + +- * mathicsscript/bindkeys.py, requirements-extra.txt, setup.py: ++ * mathicsscript/bindkeys.py, requirements-extra.txt, setup.py: + PyQT5: extra module for matplotlib + + 2021-06-15 rocky +@@ -801,7 +801,7 @@ + + 2021-05-27 rocky + +- * mathicsscript/mmalexer.py, mathicsscript/termshell.py, setup.py: ++ * mathicsscript/mmalexer.py, mathicsscript/termshell.py, setup.py: + WIP start using prompt-toolkit + + 2021-05-15 R. Bernstein +@@ -1139,7 +1139,7 @@ + + 2021-01-09 rocky + +- * NEWS.md, mathicsscript/__main__.py, mathicsscript/termshell.py: ++ * NEWS.md, mathicsscript/__main__.py, mathicsscript/termshell.py: + `-e` `--execute` is better suited for embedded use This options adds `--quiet` and shows just evaluation output as + text--execute + +@@ -1168,7 +1168,7 @@ + + 2021-01-03 rocky + +- * mathicsscript/termshell.py: Guard agains None eval returns ++ * mathicsscript/termshell.py: Guard against "None" eval returns + + 2021-01-02 rocky + +@@ -1251,7 +1251,7 @@ + + 2020-12-22 R. Bernstein + +- * : Merge pull request #7 from Mathics3/unicode-option Start to suport Unicode as a CLI option ++ * : Merge pull request #7 from Mathics3/unicode-option Start to support Unicode as a CLI option + + 2020-12-22 rocky + +@@ -1268,13 +1268,13 @@ * mathicsscript/__main__.py, mathicsscript/format.py, mathicsscript/inputrc, mathicsscript/inputrc-no-unicode, mathicsscript/inputrc-unicode, mathicsscript/termshell.py, - setup.py, test/test_completion.py: Start to suport Unicode as a CLI + setup.py, test/test_completion.py: Start to support Unicode as a CLI option - + 2020-12-12 rocky - + * mathicsscript/__main__.py, mathicsscript/termshell.py: Handle - Unicode/WL charcter code mismatches + Unicode/WL character code mismatches - + 2020-12-12 rocky - -@@ -1154,6 +1154,6 @@ - + +@@ -1292,7 +1292,7 @@ + + 2020-12-08 rocky + +- * mathicsscript/format.py: Use equal aspect ratio on ciruclar graphs ++ * mathicsscript/format.py: Use equal aspect ratio on circular graphs + + 2020-12-07 rocky + +@@ -1300,7 +1300,7 @@ + + 2020-12-07 rocky + +- * mathicsscript/__main__.py, mathicsscript/format.py: ++ * mathicsscript/__main__.py, mathicsscript/format.py: + FindSpannngTree: use layout style of parent graph + + 2020-12-07 rocky +@@ -1334,7 +1334,7 @@ + 2020-12-04 rocky - + - * mathicsscript/format.py: Handel labeled nodes better Change color to white if we have node labels Change code slightly to facilitate expanding. + * mathicsscript/format.py: Handle labeled nodes better Change color to white if we have node labels Change code slightly to facilitate expanding. - + 2020-12-04 rocky + +@@ -1406,7 +1406,7 @@ + + 2020-11-27 rocky + +- * mathicsscript/mmalexer.py, mathicsscript/termshell.py, setup.py: ++ * mathicsscript/mmalexer.py, mathicsscript/termshell.py, setup.py: + Can't use mathematica.lexer for now.. Sigh. It has promise. But recent Python gives now gives these... FutureWarning: Possible nested set at position ... + + 2020-11-27 rocky +@@ -1489,7 +1489,7 @@ + 2020-11-18 rocky + + * mathicsscript/__main__.py, mathicsscript/settings.m, +- mathicsscript/termshell.py, settings/settings.m, setup.py: ++ mathicsscript/termshell.py, settings/settings.m, setup.py: + Miscellaneous changes Settings`$ShowFullForm -> Settings`$ShowFullFormInput The old name has already caused too much confusion. Check Pygments style and give a columnized list when the name is + invalid. Also make sure to reset the Mathics variable to a the last + valid value when an invalid one is set. +@@ -1581,7 +1581,7 @@ + + * NEWS.md, admin-tools/git2cl, admin-tools/make-dist.sh, + admin-tools/pyenv-versions, mathicsscript/term_background.py, +- mathicsscript/version.py, setup.py, test/test_term_background.py: ++ mathicsscript/version.py, setup.py, test/test_term_background.py: + Get ready for release 1.1.0rc1 + + 2020-10-21 R. Bernstein +@@ -1672,4 +1672,3 @@ + + * Cull code from Mathics/main and revise ... colorama is no longer optional. We'll be using click soon. Start + to pull in my better terminal-detection script. +- diff --git a/MANIFEST.in b/MANIFEST.in index bd3e0f2..ac58d1b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include README.rst -include NEWS.md +include CHANGES.rst include ChangeLog include COPYING.txt include Makefile diff --git a/mathicsscript/completion.py b/mathicsscript/completion.py index c70cc4a..e0e1ef1 100644 --- a/mathicsscript/completion.py +++ b/mathicsscript/completion.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2021-2022, 2024 Rocky Bernstein +# Copyright (C) 2021-2022, 2024-2025 Rocky Bernstein # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -28,12 +28,12 @@ SYMBOLS = rf"[`]?({Regex.IDENTIFIER}|{Regex.NAMED_CHARACTER})(`({Regex.IDENTIFIER}|{Regex.NAMED_CHARACTER}))+[`]?" -if False: # FIXME reinstate this - NAMED_CHARACTER_START = rf"\\\[{Regex.IDENTIFIER}" - FIND_MATHICS_WORD_RE = re.compile( - rf"({NAMED_CHARACTER_START})|(?:.*[\[\(])?({SYMBOLS}$)" - ) +# # The below is a more precise definition for a Mathics3 "word" or +# # "identifier", but it is wrong somehow. NAMED_CHARACTER_START = +# rf"\\\[{Regex.IDENTIFIER}" FIND_MATHICS_WORD_RE = re.compile( +# rf"({NAMED_CHARACTER_START})|(?:.*[\[\(])?({SYMBOLS}$)" ) FIND_MATHICS_WORD_RE = re.compile(r"((?:\[)?[^\s\[\(\{]+)") + CHARGROUP_START = frozenset(["(", "[", "{", ","]) diff --git a/mathicsscript/version.py b/mathicsscript/version.py index 57739da..1c1f003 100644 --- a/mathicsscript/version.py +++ b/mathicsscript/version.py @@ -4,4 +4,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="8.0.1.dev0" # noqa +__version__="9.0.0" # noqa diff --git a/pyproject.toml b/pyproject.toml index 3efcab3..34e841a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ ] requires-python = ">=3.9" readme = "README.rst" -license = {text = "GPL-3.0-only"} +license = "GPL-3.0-or-later" keywords = ["Mathematica", "Wolfram", "Interpreter", "Shell", "Math", "CAS"] maintainers = [ {name = "Mathics3 Group"}, @@ -32,7 +32,6 @@ maintainers = [ classifiers = [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",