Skip to content

How to make a release

Konstantinos Tsilimparis edited this page Jul 22, 2026 · 32 revisions

Local steps

  1. Bump version: Edit pyproject.toml, e.g., change version = "1.1.2" to version = "1.2.0" (or whatever the new version is).

  2. Edit CHANGES file: Add major changes, minor changes and bug fixes.

  3. Run python render_citation.py to generate the list of contributors: This list is generated in the CITATION.cff file which is then used by Zenodo and Github to create citations. The contributors include everyone who has contributed since the beginning, and they are ordered by how many lines of code each person has added, from most to least. For known contributors we add the affiliations too.

Screenshot 2026-03-24 170015



GitHub steps: GitHub release, website, Zenodo

  1. Merge dev to master. This merge to master triggers the webhook and rebuilds the stable website AND triggers a github action (release.yml) that performs steps 5 and 6.

    Note: Wait for the tests to pass and finish the merge of the PR from dev to master before going to the next steps. Otherwise you will tag and release the old master branch in the next step.

    Note: To do even more "tests" we can run all the websites notebooks with the run-notebooks action. You can do that in the Actions tab and choose a dry run (=no commit):

    image
  2. Merge master back to dev.

Note: You may need to press the Merge button manually, since the GitHub Action does not have admin privileges.

  1. Create a GitHub Release: Here you can create a new tag that matches the released version (e.g., v1.2.0). Then paste the contents of the CHANGES file there too.

  2. This release triggers Zenodo, which creates a new publication.


PyPI steps

For the steps below checkout to the master branch:

  1. Build the Python package: Run pip install build and then python -m build. This creates dist/pcntoolkit-1.2.0.tar.gz and dist/pcntoolkit-1.2.0-py3-none-any.whl

  2. Upload to PyPI: Run pip install twine and then twine upload dist/*1.2.0*. It will ask for your user's API token.

Note 1: To make an API token, go to your PyPI account settings and generate one, then create a file in $HOME/.pypirc ($HOME/ is >C:/Users/user in Windows) and add the token in there:

  [pypi]
   username = __token__
   password = <add your token here>

Note 2: When you upload with twine upload dist/*1.2.0*, it is automatically checked what the package is in the .toml file and PyPI uploads it in the right project (in this case the PCNtoolkit PyPI project).

Note 3: To make sure the release is ready to go, you can install the pcntoolkit in a new venv and run a BLR and HBR tutorial:

conda create -n test_120 python=3.12
conda activate test_120 

Install packages:

conda install -c conda-forge m2w64-toolchain libpython # windows only
pip install dist/pcntoolkit-1.2.0-py3-none-any.whl

Once done, clean up with:

conda deactivate
conda remove -n test-env --all

Dissemination

  1. It is a good practice to share the release in Neurostars and inform users to upgrade the package with: pip install --upgrade pcntoolkit

Clone this wiki locally