Skip to content

Releasing

R. Bernstein edited this page Sep 1, 2025 · 23 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.

Change version in version.py

$ emacs pymathics/hello/version.py
$ source pymathics/hello/version.py
$ echo $__version__
$ git commit -m"Get ready for release $__version__" .

Update ChangeLog:

$ make ChangeLog
$ codespell ChangeLog

If ChangeLog has spelling typos, make the corrections and:

$ cp ChangeLog ChangeLog-spell-corrected
$ mv -v ChangeLog.orig ChangeLog
$ diff -u ChangeLog ChangeLog.spell-corrected > ChangeLog-spell-corrected.diff
$ codespell ChangeLog
$ 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

Update NEWS.md from ChangeLog.

Update NEWS.md from ChangeLog. Then:

$ emacs NEWS.md
$ git commit --amend .
$ git push   # get CI testing going early

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.12.6  # or some other non-current version
    $ pip install -e git+https://github.com/Mathics3/Mathics3-Module-hello.git#egg=mathics3_module_hello
    $ pip show mathics3_module_hello
    $ mathics
    In[1]:= LoadModule["pymathics.hello"]
    Out[1]= "pymathics.hello"

    In[2]:= Hello[]
    Out[2]= "Hellow, World!"
    In[3]:= Hello["everyone"]
    Out[2]= "Hello, Everyone!"

    $ pip uninstall mathics3_module_hello
    $ popd

Make packages, check, and tag.

$ make dist
$ twine check dist/mathics3_module_hello-$__version__*

Release on GitHub

Goto https://github.com/Mathics3/Mathics3-Module-hello/releases/new

Set version, copy in CHANGES.rst item, upload binaries.

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

Todo: turn this into a script in admin-tools

    $ [[ ! -d /tmp/gittest ]] && mkdir /tmp/gittest
    $ pushd /tmp/gittest
    $ pip install -e git+https://github.com/Mathics3/Mathics3-Module-hello.git$__version__#egg=mathics3_module_hello
    $ mathics
    In[1]:= LoadModule["pymathics.hello"]
    Out[1]= "pymathics.hello"

    In[2]:= Hello[]
    Out[2]= "Hellow, World!"
    In[3]:= Hello["everyone"]
    Out[2]= "Hello, Everyone!"

    $ pip uninstall mathics3_module_hello
    $ popd

Get on PyPI

    $ twine upload --verbose dist/mathics3_module_hello-${__version__}*

Check on https://pypi.org/project/Mathics3-Module-hello/

Push and Pull tags:

$ git pull --tags

Move dist files to uploaded

    $ mv -v dist/pymathics/hello-${__version__}* dist/uploaded

Bump version

  • Update __version__ to NEXT_VERSION.dev0