From aee726ecefe5ab9df524f1106dda8b6a104c9741 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 7 Nov 2026 12:24:47 -0500 Subject: [PATCH 1/4] Administrivia roll in 3.15 and new version of workflows --- .github/workflows/isort-and-black-checks.yml | 8 ++++---- .github/workflows/macos.yml | 6 +++--- .github/workflows/mathics3-doctest.yml | 6 +++--- .github/workflows/ubuntu.yml | 6 +++--- .github/workflows/windows.yml | 6 +++--- pyproject.toml | 1 + 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/isort-and-black-checks.yml b/.github/workflows/isort-and-black-checks.yml index e24e766..1c5620f 100644 --- a/.github/workflows/isort-and-black-checks.yml +++ b/.github/workflows/isort-and-black-checks.yml @@ -9,11 +9,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - name: Set up Python 3.14 - uses: actions/setup-python@v6 + - uses: actions/checkout@v7 + - name: Set up Python 3.15 + uses: actions/setup-python@v7 with: - python-version: 3.14 + python-version: 3.15 - name: Install click, black, and isort run: pip install 'click==8.2.1' 'black==25.11.0' - name: Run black --check . diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8d921e9..36674f5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,11 +12,11 @@ jobs: strategy: matrix: os: [macOS] - python-version: ['3.14', '3.12', '3.13'] + python-version: ['3.15', '3.12', '3.13'] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/mathics3-doctest.yml b/.github/workflows/mathics3-doctest.yml index 5dbe985..403085f 100644 --- a/.github/workflows/mathics3-doctest.yml +++ b/.github/workflows/mathics3-doctest.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.14'] + python-version: ['3.15'] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install OS dependencies diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3b0c494..9235ba1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.11', '3.12', '3.13', '3.14'] + python-version: ['3.11', '3.12', '3.13', '3.14', '3.15'] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install Mathics3 scanner without JSON files diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 574619e..4fcdfc2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,11 +12,11 @@ jobs: strategy: matrix: os: [windows] - python-version: ['3.11', '3.14'] + python-version: ['3.12', '3.15'] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/pyproject.toml b/pyproject.toml index 00f5353..24c520f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Scientific/Engineering", From b4a10312730854a2ee7cccd204087c6768171306 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 7 Nov 2026 18:09:05 -0500 Subject: [PATCH 2/4] Address tombouctou's review and add an .isort.cfg --- .github/workflows/isort-and-black-checks.yml | 24 +++++++++++--------- .github/workflows/macos.yml | 2 +- .isort.cfg | 10 ++++++++ 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 .isort.cfg diff --git a/.github/workflows/isort-and-black-checks.yml b/.github/workflows/isort-and-black-checks.yml index 1c5620f..3509e79 100644 --- a/.github/workflows/isort-and-black-checks.yml +++ b/.github/workflows/isort-and-black-checks.yml @@ -15,16 +15,18 @@ jobs: with: python-version: 3.15 - name: Install click, black, and isort - run: pip install 'click==8.2.1' 'black==25.11.0' + run: pip install 'click==8.2.1' 'black==25.11.0' 'isort==8.0.1' - name: Run black --check . 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: Run isort --check . + run: isort --check . + # - 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/macos.yml b/.github/workflows/macos.yml index 36674f5..d3678cd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [macOS] - python-version: ['3.15', '3.12', '3.13'] + python-version: ['3.15', '3.14', '3.13', '3.12'] steps: - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..bd69b54 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,10 @@ +[settings] +multi_line_output = 3 +include_trailing_comma = True +force_grid_wrap = 0 +use_parentheses = True +line_length = 88 +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +default_section = THIRDPARTY +combine_as_imports = 1 +profile = black From e523745999b1e731332eb2bef551a38d7b24651d Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 7 Nov 2026 18:20:21 -0500 Subject: [PATCH 3/4] isort and black according more recent conventions --- mathics_scanner/generate/rl_inputrc.py | 13 +++++++------ test/test_character_table_consistency.py | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/mathics_scanner/generate/rl_inputrc.py b/mathics_scanner/generate/rl_inputrc.py index dad47d4..67c6896 100755 --- a/mathics_scanner/generate/rl_inputrc.py +++ b/mathics_scanner/generate/rl_inputrc.py @@ -8,8 +8,10 @@ """ import sys -from mathics_scanner.characters import ALIASED_CHARACTERS -from mathics_scanner.characters import replace_wl_with_plain_text as r +from mathics_scanner.characters import ( + ALIASED_CHARACTERS, + replace_wl_with_plain_text as r, +) def _escape(s: str) -> str: @@ -38,11 +40,11 @@ def generate_inputrc(fd=sys.stdout, use_unicode=True) -> None: try: fd.write(_format(alias, use_unicode)) except UnicodeEncodeError: - sys.stderr.write("Error trying to convert alias %s; skipping\n" % alias) + sys.stderr.write(f"Error trying to convert alias {alias}; skipping\n") def usage(): - sys.stderr.write("usage: %s {inputrc-unicode | inputrc-no-unicode}\n" % sys.argv[0]) + sys.stderr.write(f"usage: {sys.argv[0]} {{inputrc-unicode | inputrc-no-unicode}}\n") sys.exit(1) @@ -54,8 +56,7 @@ def usage(): default_encoding = sys.getdefaultencoding() if default_encoding != "utf-8": sys.stderr.write( - "sys.defaultencoding() is %s so we can't generate unicode output\n" - % (default_encoding) + f"sys.defaultencoding() is {default_encoding} so we can't generate unicode output\n" ) sys.exit(2) generate_inputrc(use_unicode=True) diff --git a/test/test_character_table_consistency.py b/test/test_character_table_consistency.py index c6c652a..3ac2a8d 100644 --- a/test/test_character_table_consistency.py +++ b/test/test_character_table_consistency.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- - from test.helper import json_data, yaml_data -from mathics_scanner.characters import replace_unicode_with_wl as unicode_to_wl -from mathics_scanner.characters import replace_wl_with_plain_text as wl_to_unicode +from mathics_scanner.characters import ( + replace_unicode_with_wl as unicode_to_wl, + replace_wl_with_plain_text as wl_to_unicode, +) def test_ascii_fields_in_json(): @@ -20,7 +20,7 @@ def test_ascii_fields_in_json(): "operator-to-ascii", "operator-to-unicode", ): - for name in json_data[ascii_key_dict].keys(): + for name in json_data[ascii_key_dict]: assert ( name.isascii() ), f"Key name of table {ascii_key_dict} should be ASCII; is: {name}" From c87d28c1d3f593a668c1ddc436bf67baac052663 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 7 Nov 2026 18:23:25 -0500 Subject: [PATCH 4/4] Include 3.14 testing on MS Windows --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4fcdfc2..fa44b8e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [windows] - python-version: ['3.12', '3.15'] + python-version: ['3.12', '3.14', '3.15'] steps: - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }}