From cafb9c817db66b360eb8c84efe03fa3075125fbe Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Mon, 19 Aug 2024 14:16:11 -0400 Subject: [PATCH] Get ready for release 7.0.0 (#6) --- .pre-commit-config.yaml | 9 +++++++-- ChangeLog-spell-corrected.diff | 16 ++++++++++++++++ Makefile | 1 + NEWS.md | 10 ++++++++++ admin-tools/check-versions.sh | 27 +++++++++++++++++++++++++++ admin-tools/make-dist.sh | 26 ++++++++------------------ admin-tools/pyenv-versions | 2 +- pymathics/hello/version.py | 2 +- 8 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 ChangeLog-spell-corrected.diff create mode 100644 NEWS.md create mode 100755 admin-tools/check-versions.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be3ee5b..d73159b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,13 +9,18 @@ repos: stages: [commit] - id: end-of-file-fixer stages: [commit] - - id: trailing-whitespace +# - repo: https://github.com/pycqa/isort +# rev: 5.10.1 +# hooks: +# - id: isort +# stages: [commit] - repo: https://github.com/psf/black rev: 22.3.0 hooks: - id: black language_version: python3 - exclude: 'mathicsscript/version.py' + exclude: 'pymathics/hello/version.py' + stages: [commit] - repo: https://github.com/pycqa/flake8 rev: 3.9.2 hooks: diff --git a/ChangeLog-spell-corrected.diff b/ChangeLog-spell-corrected.diff new file mode 100644 index 0000000..6624d27 --- /dev/null +++ b/ChangeLog-spell-corrected.diff @@ -0,0 +1,16 @@ +--- ChangeLog 2024-08-19 13:00:26.144430865 -0400 ++++ ChangeLog-spell-corrected 2024-08-19 12:59:33.866689400 -0400 +@@ -10,7 +10,7 @@ + 2024-08-19 Juan Mauricio Matera + + * pymathics/hello/__main__.py: adding blanklines between and +- the examples in docstrings (#4) * addiing blanklines between and the examples in docstrings * Update __main__.py --------- Co-authored-by: R. Bernstein ++ the examples in docstrings (#4) * adding blanklines between and the examples in docstrings * Update __main__.py --------- Co-authored-by: R. Bernstein + + 2024-08-19 rocky + +@@ -95,4 +95,3 @@ + 2020-10-30 rocky + + * A simple PyMathics module A "Hello, World!" PyMathics Function and Symbol definition. Adapted from mmatera's PyMathics "testpymathicsmodule" +- diff --git a/Makefile b/Makefile index 98858b4..bddc09a 100644 --- a/Makefile +++ b/Makefile @@ -63,3 +63,4 @@ rmChangeLog: #: Create a ChangeLog from git via git log and git2cl ChangeLog: rmChangeLog git log --pretty --numstat --summary | $(GIT2CL) >$@ + patch ChangeLog < ChangeLog-spell-corrected.diff diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..6f56292 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,10 @@ +7.0.0 +----- + +* Revise for 7.0.0 Mathics3 API; we need to explicilty load builtins + + +1.0.0 +----- + +* First release. diff --git a/admin-tools/check-versions.sh b/admin-tools/check-versions.sh new file mode 100755 index 0000000..783c8d2 --- /dev/null +++ b/admin-tools/check-versions.sh @@ -0,0 +1,27 @@ +#!/bin/bash +function finish { + cd $mathics_hello_owd +} + +# FIXME put some of the below in a common routine +mathics_hello_owd=$(pwd) +trap finish EXIT + +cd $(dirname ${BASH_SOURCE[0]}) +if ! source ./pyenv-versions ; then + exit $? +fi + +cd .. +for version in $PYVERSIONS; do + echo --- $version --- + if ! pyenv local $version ; then + exit $? + fi + make clean && pip install -e . + if ! make check; then + exit $? + fi + echo === $version === +done +finish diff --git a/admin-tools/make-dist.sh b/admin-tools/make-dist.sh index 1f3b962..e52d0af 100755 --- a/admin-tools/make-dist.sh +++ b/admin-tools/make-dist.sh @@ -3,11 +3,11 @@ PACKAGE=pymathics-hello # FIXME put some of the below in a common routine function finish { - cd $owd + cd $mathics_hello_owd } cd $(dirname ${BASH_SOURCE[0]}) -owd=$(pwd) +mathics_hello_owd=$(pwd) trap finish EXIT if ! source ./pyenv-versions ; then @@ -19,21 +19,11 @@ cd .. source pymathics/hello/version.py echo $__version__ -for pyversion in $PYVERSIONS; do - if ! pyenv local $pyversion ; then - exit $? - fi - # pip bdist_egg create too-general wheels. So - # we narrow that by moving the generated wheel. - - # Pick out first two number of version, e.g. 3.7.9 -> 37 - first_two=$(echo $pyversion | cut -d'.' -f 1-2 | sed -e 's/\.//') - rm -fr build - python setup.py develop - python setup.py bdist_egg - python setup.py bdist_wheel - python setup.py bdist_wheel --universal - mv -v dist/${PACKAGE}-$VERSION-{py2.py3,py$first_two}-none-any.whl -done +if ! pyenv local $pyversion ; then + exit $? +fi +python setup.py bdist_wheel --universal +mv -v dist/pymathics_hello-${__version__}-{py2.,}py3-none-any.whl python ./setup.py sdist +finish diff --git a/admin-tools/pyenv-versions b/admin-tools/pyenv-versions index f9c3c2e..406855c 100644 --- a/admin-tools/pyenv-versions +++ b/admin-tools/pyenv-versions @@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then echo "This script should be *sourced* rather than run directly through bash" exit 1 fi -export PYVERSIONS='3.6.13 3.7.10 3.8.10 3.9.5' +export PYVERSIONS='3.8 3.9 3.10 3.11' diff --git a/pymathics/hello/version.py b/pymathics/hello/version.py index b045e29..cc1f721 100644 --- a/pymathics/hello/version.py +++ b/pymathics/hello/version.py @@ -5,4 +5,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="7.0.0dev1" # noqa +__version__="7.0.0" # noqa