diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3965f01..7e37617 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,31 @@ +default_language_version: + python: python exclude: 'mathics_pygments/version.py' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v4.5.0 hooks: + - id: check-merge-conflict + - id: check-yaml - id: debug-statements + stages: [pre-commit] - id: end-of-file-fixer + stages: [pre-commit] + exclude: ChangeLog-spell-corrected.diff - id: trailing-whitespace + exclude: ChangeLog-spell-corrected.diff + - id: check-json + exclude: mathics_pygments/data/mma-tables.json +- repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + stages: [pre-commit] + args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: 21.6b0 + rev: 23.12.1 hooks: - id: black language_version: python3 + stages: [pre-commit] + exclude: version.py diff --git a/CHANGES.rst b/CHANGES.rst index 1f54e69..605b6f0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,13 @@ CHANGES ======= +1.0.4 +----- + +This is a Transitional release. + +Although there is a dependency on mathics-scanner, we don't use it since tables have changed. There is some code for reading the YAML takes from the project though. With a newer and better mathics-scanner, we should be able to revise this code and use the tokenizer from mathics-scanner and simplify things greatly. + 1.0.3 ----- diff --git a/Makefile b/Makefile index b88d98f..835d60c 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ install: #: Run py.test tests. Use environment variable "o" for pytest options pytest: - py.test tests $o + $(PYTHON) -m pytest tests $o #: Remove ChangeLog diff --git a/admin-tools/check-versions.sh b/admin-tools/check-versions.sh index 19b6793..a120337 100755 --- a/admin-tools/check-versions.sh +++ b/admin-tools/check-versions.sh @@ -1,10 +1,10 @@ #!/bin/bash function finish { - cd $owd + cd $mathics_pygments_owd } # FIXME put some of the below in a common routine -owd=$(pwd) +mathics_pygments_owd=$(pwd) trap finish EXIT cd $(dirname ${BASH_SOURCE[0]}) @@ -24,3 +24,4 @@ for version in $PYVERSIONS; do fi echo === $version === done +finish diff --git a/admin-tools/make-JSON-tables.sh b/admin-tools/make-JSON-tables.sh new file mode 100755 index 0000000..2069659 --- /dev/null +++ b/admin-tools/make-JSON-tables.sh @@ -0,0 +1,7 @@ +#!/bin/bash +bs=${BASH_SOURCE[0]} +json_tables_owd=$(pwd) +mydir=$(dirname $bs) +cd $mydir +python ../mathics_pygments/generate/build_pygments_tables.py -o $mydir/../mathics_pygments/data/mma-tables-new.json +cd $json_tables_owd diff --git a/admin-tools/make-tables.sh b/admin-tools/make-tables.sh deleted file mode 100755 index d16de5b..0000000 --- a/admin-tools/make-tables.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -bs=${BASH_SOURCE[0]} -mydir=$(dirname $bs) - -mathics-generate-json-table --field=ascii-operators --field=unicode-operators -o $mydir/../mathics_pygments/data/mma-tables.json diff --git a/mathics_pygments/version.py b/mathics_pygments/version.py index 3388c31..b986b1f 100644 --- a/mathics_pygments/version.py +++ b/mathics_pygments/version.py @@ -5,4 +5,4 @@ # space around "=" below. # fmt: off -__version__="1.0.3" # noqa +__version__="1.0.4" # noqa