Skip to content

Releasing

rocky edited this page Apr 19, 2026 · 22 revisions

Table of Contents

Get latest sources:

$ git pull

If we are tracking an API change, check .github/workflows to see if we can use PyPI packages instead of GitHub repositories.

Check that Mathics3 isn't broken with this code:

$ make check-mathics3

Change version in mathics/version.py

Update __version__ in mathics_scanner/version.py.

$ source mathics_scanner/version.py # to set in POSIX shell
$ echo $__version__

Make release branch:

$ git checkout -b release-$__version__
$ git commit -m"Get ready for release $__version__" .

Update Changes

$ make ChangeLog
$ head -n 2200 ChangeLog | codespell -

If ChangeLog has spelling typos, make the corrections and:

$ mv -v ChangeLog ChangeLog-spell-corrected
$ cp -vp ChangeLog.orig ChangeLog
$ diff -u ChangeLog ChangeLog-spell-corrected > ChangeLog-spell-corrected.diff

If the diff looks like it captures the corrections::

$ diff -u ChangeLog ChangeLog.spell-corrected > ChangeLog-spell-corrected.diff
$ make ChangeLog
$ diff -u ChangeLog ChangeLog-spell-corrected

If the diff looks like it captures the corrections:

$ diff -u ChangeLog ChangeLog-spell-corrected > ChangeLog-spell-corrected.diff
$ make ChangeLog

And see that everything patches fine.

Update CHANGES.rst from ChangeLog.

$ make check
$ git commit --amend .

http://rst.ninjs.org/ can be used for checking the RsT.

$ git push  -u origin HEAD # get CI testing going early

Create GithHub PR and check CI on GitHub.

Create a GitHub pull request. After CI finishes, and PR merged:

$ git checkout master
$ git pull origin HEAD

Check package from github

Todo: turn this into a script in admin-tools

$ [[ ! -d /tmp/gittest ]] && mkdir /tmp/gittest; pushd /tmp/gittest
$ pyenv local 3.13.5  # Not the most recent Python version in a release
$ pip install -e git+https://github.com/mathics3/Mathics3-scanner.git#egg=Mathics3_scanner
$ (cd /tmp/gittest/src/mathics3-scanner/ && make)
$ python -m mathics_scanner.generate.rl_inputrc inputrc-no-unicode
$ mathics3-codeparser-tokenize --version  # see that version number is correct
$ echo '\( Rowbox[\\[theta] \+  "2" \)' | mathics3-codeparser-tokenize
$ pip uninstall Mathics3-scanner
$ popd

Make packages and check

$ ./admin-tools/check-versions.sh
$ ./admin-tools/make-dist.sh
$ twine check dist/mathics3_scanner-$__version__*
$ tar -tf dist/mathics3_scanner-$__version__tar.gz

Try out the wheel in a separate Python version

$ cd dist
$ pyenv local *not_currenv_python*
$ pip install mathics3_scanner-${__version__}-py3-none-any.whl
$ cd ..

Release on Github

Goto https://github.com/mathics3/Mathics3-scanner/releases/new

Now check the tagged release. (Checking the untagged release was previously done).

https://cloudconvert.com/rst-to-md can be used to change the CHANGES.rst section to markdown.

Todo: turn this into a script in admin-tools

$ git pull # to pull down new tag
$ pushd /tmp/gittest
$ pip install -e git+https://github.com/mathics3/mathics-scanner.git@${__version__}#egg=mathics-scanner
$ (cd /tmp/gittest/src/mathics-scanner/ && make)
$ python -m mathics_scanner.generate.rl_inputrc inputrc-no-unicode
$ pip uninstall mathics-scanner
$ popd

Upload the release to PyPI

Upload it to PyPI with twine

$ twine upload dist/mathics3_scanner-${__version__}*

Move uploaded versions to dist/uploaded.

Test PYPI packages

$ cd /tmp/gittest/src/mathics-scanner
$ pip install Mathics3-scanner

Post-Release

  • Update docker setup
  • Update __version__ to NEXT_VERSION.dev0