Create an .env file in the root directory of the project and add the following:
PYTHONPATH=<your_workspace_folder_path>/src
Release tags follow the format vX.Y.Z (e.g., v0.1.0, v1.0.0). The version
in the tag must match the version field in pyproject.toml.
- Update the
versionfield inpyproject.tomlto the new version. - Commit the version bump:
git commit -am "Bump version to X.Y.Z". - Push the commit to
main. - Create a GitHub Release:
- Go to Releases → Draft a new release.
- Create a new tag
vX.Y.Ztargetingmain. - Add release notes describing the changes.
- Click Publish release.
- The
publish.ymlworkflow runs automatically, building and publishing the package to PyPI.
The publish.yml GitHub Actions workflow:
- Build — Checks out the code, validates the tag version matches
pyproject.toml, builds sdist and wheel distributions, and verifies them withtwine check. - Publish — Downloads the build artifacts and publishes to PyPI using trusted publishing (OIDC).
After the workflow completes, verify the package at https://pypi.org/project/regshape/. You can also install it with:
pip install regshape==X.Y.Z
PyPI trusted publishing must be configured once by the repository owner:
- On PyPI, go to Account → Publishing → Add a new pending publisher.
- Fill in: Owner =
toddysm, Repository =regshape, Workflow =publish.yml, Environment =pypi. - On GitHub, create an environment named
pypiunder Settings → Environments. Optionally add required reviewers for an approval gate.