From d4ba687bf0e7f58f58ffaf3e77a34d85e53ce2f3 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 3 Apr 2026 11:21:31 -0400 Subject: [PATCH 1/4] Roll in 3.14 and rollout 3.10 Go over CI. --- .github/workflows/consistency-checks.yml | 15 ++++++++------- .github/workflows/isort-and-black-checks.yml | 4 ++-- .github/workflows/ubuntu.yml | 18 ++++++++++++------ pyproject.toml | 6 +++--- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/consistency-checks.yml b/.github/workflows/consistency-checks.yml index 0dbf299..3884590 100644 --- a/.github/workflows/consistency-checks.yml +++ b/.github/workflows/consistency-checks.yml @@ -13,27 +13,28 @@ jobs: matrix: python-version: ['3.13'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest + python -m pip install pytest setuptools python -m pip install Mathics3-Module-Base - # Can comment out when next Mathics3 core and Mathics-scanner are released - # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] + # Until the next Mathics3-scanner release + git clone https://github.com/Mathics3/Mathics3-scanner + (cd Mathics3-scanner && pip3 install -e .[full] --no-build-isolation && bash -x ./admin-tools/make-JSON-tables.sh) # Until the next mathics-core release git clone https://github.com/Mathics3/mathics-core - (cd mathics-core && python -m pip install -e .[full]) + (cd mathics-core && python -m pip install --no-build-isolation -e .[full]) (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh) - name: Install Mathics3 Module nltk run: | python -m pip install --no-build-isolation setuptools Mathics3[full] nltk PatternLite enchant make develop - - name: Test Mathics Consistency and Style + - name: Test Mathics3 Consistency and Style run: | make check-consistency-and-style diff --git a/.github/workflows/isort-and-black-checks.yml b/.github/workflows/isort-and-black-checks.yml index 190c5fc..f5054c5 100644 --- a/.github/workflows/isort-and-black-checks.yml +++ b/.github/workflows/isort-and-black-checks.yml @@ -9,9 +9,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python 3.13 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13 - name: Install click, black and isort diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 8fea1ac..c6d2de0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,23 +11,26 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.12', '3.13'] + python-version: ['3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest + python -m pip install pytest setuptools # Go over and comment out stuff when next Mathics core and Mathics-scanner are released + # Go over and comment out stuff when next Mathics core and Mathics3-scanner are released + git clone https://github.com/Mathics3/Mathics3-scanner + (cd Mathics3-scanner && pip3 install -e .[full] --no-build-isolation && bash -x ./admin-tools/make-JSON-tables.sh) # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # Until the next mathics-core release git clone https://github.com/Mathics3/mathics-core - (cd mathics-core && python -m pip install -e .[full]) - (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh) + (cd mathics-core && pip3 install -e .[full] --no-build-isolation) + (cd mathics-core && bash -x ./admin-tools/make-JSON-tables.sh) - name: Install Mathics3 Module nltk run: | @@ -35,4 +38,7 @@ jobs: make develop - name: Test Mathics3 Module nltk run: | + python -m pip install -e .[full] --no-build-isolation + # make develop + - name: Test Mathics3 Module nltk make -j3 check diff --git a/pyproject.toml b/pyproject.toml index 94f0278..ec3125d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ build-backend = "setuptools.build_meta" name = "Mathics3-Module-nltk" description = "Mathics3 Natural Language Toolkit module" dependencies = [ - "Mathics3>=9.0.0", + "Mathics3>9.0.0", "Mathics3-Module-Base>=9.0.0", "click>=8.0", "joblib>=1.0.1", @@ -35,7 +35,7 @@ dependencies = [ "spacy>=3.4", "wasabi<1.1.0,>=0.8.2", ] -requires-python = ">=3.10" +requires-python = ">=3.11" readme = "README.rst" license = "GPL-3.0-or-later" keywords = ["Mathematica", "Wolfram", "Interpreter", "Shell", "Math", "CAS"] @@ -46,10 +46,10 @@ classifiers = [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "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 :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Scientific/Engineering", From 062be2ac1272224540f8ac9b596497490c35c2e8 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 3 Apr 2026 11:24:40 -0400 Subject: [PATCH 2/4] black --- .github/workflows/ubuntu.yml | 2 -- pymathics/natlang/normalization.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c6d2de0..14ca86a 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -36,8 +36,6 @@ jobs: run: | python -m pip install --no-build-isolation setuptools Mathics3[full] nltk PatternLite enchant make develop - - name: Test Mathics3 Module nltk - run: | python -m pip install -e .[full] --no-build-isolation # make develop - name: Test Mathics3 Module nltk diff --git a/pymathics/natlang/normalization.py b/pymathics/natlang/normalization.py index 3bb7a62..438ba18 100644 --- a/pymathics/natlang/normalization.py +++ b/pymathics/natlang/normalization.py @@ -9,6 +9,7 @@ This module uses spacy as a backend. """ + import itertools from itertools import islice from typing import Optional From d8ba3fdade3fff145e76e1d4c316a8a0157ab501 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 3 Apr 2026 11:30:53 -0400 Subject: [PATCH 3/4] CI woes --- .github/workflows/isort-and-black-checks.yml | 26 ++++++++++---------- .github/workflows/ubuntu.yml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/isort-and-black-checks.yml b/.github/workflows/isort-and-black-checks.yml index f5054c5..bc28edc 100644 --- a/.github/workflows/isort-and-black-checks.yml +++ b/.github/workflows/isort-and-black-checks.yml @@ -3,30 +3,30 @@ # Othewrwise, Black is run and its changes are committed back to the incoming pull request. # https://github.com/cclauss/autoblack -name: isort and black +name: isort and black check on: [pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Set up Python 3.13 + - name: Set up Python 3.14 uses: actions/setup-python@v6 with: - python-version: 3.13 + python-version: 3.14 - name: Install click, black and isort run: pip install 'click==8.2.1' 'black==25.11.0' 'isort==5.13.2' - name: Run isort --check . run: isort --check . - name: Run black --check --diff . run: black --check --diff . - - name: If needed, commit black changes to the pull request - if: failure() - run: | - black . - git config --global user.name 'autoblack' - git config --global user.email 'rocky@users.noreply.github.com' - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY - git checkout $GITHUB_HEAD_REF - git commit -am "fixup: Format Python code with Black" - git push + # - name: If needed, commit black changes to the pull request + # if: failure() + # run: | + # black . + # git config --global user.name 'autoblack' + # git config --global user.email 'rocky@users.noreply.github.com' + # git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY + # git checkout $GITHUB_HEAD_REF + # git commit -am "fixup: Format Python code with Black" + # git push diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 14ca86a..753f0eb 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -29,7 +29,7 @@ jobs: # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # Until the next mathics-core release git clone https://github.com/Mathics3/mathics-core - (cd mathics-core && pip3 install -e .[full] --no-build-isolation) + (cd mathics-core && pip3 install --no-biuild-isolation -e .[full]) (cd mathics-core && bash -x ./admin-tools/make-JSON-tables.sh) - name: Install Mathics3 Module nltk From 576ff98f85c33cbd63bcc0b291c5a301087af4cf Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 3 Apr 2026 11:36:49 -0400 Subject: [PATCH 4/4] isort and black --- .github/workflows/isort-and-black-checks.yml | 2 -- pymathics/natlang/__init__.py | 3 +-- pymathics/natlang/nltk.py | 4 ++-- pymathics/natlang/spacy.py | 1 - pymathics/natlang/textual_analysis.py | 1 - 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/isort-and-black-checks.yml b/.github/workflows/isort-and-black-checks.yml index bc28edc..955df1a 100644 --- a/.github/workflows/isort-and-black-checks.yml +++ b/.github/workflows/isort-and-black-checks.yml @@ -16,8 +16,6 @@ jobs: python-version: 3.14 - name: Install click, black and isort run: pip install 'click==8.2.1' 'black==25.11.0' 'isort==5.13.2' - - name: Run isort --check . - run: isort --check . - name: Run black --check --diff . run: black --check --diff . # - name: If needed, commit black changes to the pull request diff --git a/pymathics/natlang/__init__.py b/pymathics/natlang/__init__.py index 9e8cb39..ccc6fbe 100644 --- a/pymathics/natlang/__init__.py +++ b/pymathics/natlang/__init__.py @@ -48,6 +48,7 @@ WordDefinition, WordList, ) +from pymathics.natlang.linguistic_data.translation import LanguageIdentify from pymathics.natlang.manipulate import Pluralize from pymathics.natlang.normalization import ( DeleteStopwords, @@ -65,8 +66,6 @@ WordSimilarity, WordStem, ) - -from pymathics.natlang.linguistic_data.translation import LanguageIdentify from pymathics.natlang.version import __version__ pymathics_version_data = { diff --git a/pymathics/natlang/nltk.py b/pymathics/natlang/nltk.py index b17b678..405f1c3 100644 --- a/pymathics/natlang/nltk.py +++ b/pymathics/natlang/nltk.py @@ -3,17 +3,17 @@ """ nltk backend """ + import re from itertools import chain import nltk -from pattern.text.en import lexeme, pluralize - from mathics.builtin.codetables import iso639_3 from mathics.core.atoms import String from mathics.core.builtin import Builtin, MessageException from mathics.core.evaluation import Evaluation from mathics.core.symbols import strip_context +from pattern.text.en import lexeme, pluralize # Don't consider this for user documentation no_doc = True diff --git a/pymathics/natlang/spacy.py b/pymathics/natlang/spacy.py index 36c2403..840cb1f 100644 --- a/pymathics/natlang/spacy.py +++ b/pymathics/natlang/spacy.py @@ -12,7 +12,6 @@ from typing import Optional import spacy - from mathics.core.atoms import String from mathics.core.builtin import Builtin from mathics.core.evaluation import Evaluation diff --git a/pymathics/natlang/textual_analysis.py b/pymathics/natlang/textual_analysis.py index faa380e..9061ee9 100644 --- a/pymathics/natlang/textual_analysis.py +++ b/pymathics/natlang/textual_analysis.py @@ -13,7 +13,6 @@ import enchant import nltk import spacy - from mathics.core.atoms import Integer, Real, String from mathics.core.builtin import Builtin from mathics.core.evaluation import Evaluation