Skip to content

Releasing

rocky edited this page Apr 27, 2026 · 9 revisions

Making a Mathics3 Kernel Release

Note: This package depends on ``Mathics3-scanner``, so if that needs a release too, do that before this.

If there is a newer release of Mathics3-scanner, update .github/workflows to use from PyPI rather than from github.

Check to see if we use newer releases of numpy, sympy, scipy, etc.

Look over https://pypi.org/project/Mathics3/ to see that the page renders properly. Update or fix if necessary.

$ PACKAGE="Mathics3"
$ github_top_dir="mathics-core"
# Edit mathics/version.py
$ source mathics/version.py # to set in POSIX shell
$ echo $__version__

Mathics3 Kernel Workflows update?

Check .github/workflows/*.yml to make see if we are using github versions (of scanner) for testing. If so adjust.

Create a new Mathics3 Kernel branch

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

Update Mathics3 Kernel Changes

$ make ChangeLog
$ head -n 6000 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

And see that everything patches fine.

Update CHANGES.rst from ChangeLog

$ make -j3 check
$ git commit --amend .
$ git push -u origin HEAD # get CI testing going early

Make Mathics3 PDF (optional)

This step can be deferred until Mathics3 Modules are updated.

$ pyenv local 3.14 # or whatever latest Python you want to build doc with
$ make clean
$ make doc

Look at resulting PDF and colophon

Copy PDF to mathics.github.io

Check Mathics3 Kernel Python versions

$ ./admin-tools/check-versions.sh

Merge Mathics3 Kernel Release

Go to github and merge release into master.

Then...

$ git checkout master
$ git pull

Check Mathics3 Kernel package from github

TODO: turn this into a script in admin-tools

$ [[ ! -d /tmp/gittest ]] && mkdir /tmp/gittest; pushd /tmp/gittest
$ pyenv local 3.12.6 # Use a version that is not the most recent
$ pip install -e git+https://github.com/Mathics3/${github_top_dir}.git#egg=${PACKAGE}
$ mathics --version # see that new version appears
$ mathics3-codeparser-parse --version  # see that version number is correct
$ echo '2x + y^2' | mathics3-codeparser-parse
$ mathics -c "1+2"
$ pip uninstall ${PACKAGE}
$ popd

Make Mathics3 Kernel packages and check

Go over mathics/Packages to make sure there is nothing that should not be in distribution. No private copies of packages.

$ ./admin-tools/make-dist.sh
$ twine check dist/mathics3-$__version__*

See what is inside

$ tar -tvf ../dist/mathics3-${__version}.tar.gz

Try out the tar or the wheel in a separate Python version.

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

Release Mathics3 Kernel on Github

Go to https://github.com/Mathics3/mathics-core/releases/new

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

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

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/${github_top_dir}.git@${__version__}#egg=${PACKAGE}
$ mathics3 --version
$ mathics3 -c 1+1
$ pip uninstall ${PACKAGE}
$ popd

Upload the Mathics3 Kernel release to PyPI

Upload it to PyPI with twine:

$ twine upload --verbose dist/$PACKAGE-${__version__}*{whl,gz}

Move Mathics3 Kernel dist files to uploaded

$ [[ ! -d dist/uploaded ]] || mkdir dist/uploaded
$ mv -v dist/$PACKAGE*{whl,gz} dist/uploaded/

Post Mathics3 Kernel Release

Add 1 to release number of version in mathics/version.py; also append "dev0".

Clone this wiki locally