Releases are automated. Pushing a version tag builds the package, publishes it to PyPI, and attaches the built files to a GitHub Release. Nothing is uploaded by hand.
- Bump the version in
pygad/_version.py. This is the only place the version lives. - Update the release notes in the docs if you keep them there.
- Commit and push:
git add pygad/_version.py git commit -m "Release 3.6.1" git push - Wait for the test workflow (
main.yml) to pass on that commit. - Tag the release and push the tag:
git tag 3.6.1 git push origin 3.6.1
The release workflow does the rest: it builds the wheel and sdist, publishes
them to PyPI, and creates a GitHub Release with both files attached. Follow it
with gh run watch or the Actions tab.
- The tag must match
pygad/_version.pyand is the bare version number with novprefix, for example3.6.1. The tag is what triggers the release. - Every release needs a new version number. PyPI does not allow re-uploading or overwriting a version that already exists.
- Do not run
twine uploador upload files to the GitHub Release by hand. The tag does both for you.
publish.sh can build and upload to PyPI from your machine if you ever need it.
Done once per project. No API token is involved, because PyPI trusted publishing is tokenless.
- On the PyPI
pygadproject, open Settings, then Publishing, and add a GitHub publisher: ownerahmedfgad, repositoryGeneticAlgorithmPython, workflowrelease.yml, environmentpypi. - In the GitHub repo, open Settings, then Environments, and create an environment
named
pypi.