-
Notifications
You must be signed in to change notification settings - Fork 0
Build and release processes
Alberto Rocha edited this page Oct 31, 2024
·
3 revisions
This guide explains how to publish a new version of the ElectionBuddy Python package to PyPI.
- VS Code with Remote Containers extension
- Project cloned locally
-
Copy the environment file:
cp .devcontainer/.env.sample .devcontainer/.env
-
Get the PyPI token
-
Update the environment file:
- Open
.devcontainer/.env
- Replace
your-token-here
with the token you copied from 1Password
PYPI_TOKEN=your-token-here
- Open
- Make sure you're in the project root directory
- Run the build command:
This will create distribution files in the
hatch build
dist/
directory.
-
Upload the distribution files:
twine upload dist/*
-
Verify the upload:
- Visit https://pypi.org/project/electionbuddy-python/
- Check that the new version is listed
- If you get authentication errors, make sure the token in your
.env
file is correct and the container was rebuilt after updating it - If
twine upload
fails, try runningtwine check dist/*
first to validate the distribution files - If you need to rebuild the dev container:
- Open Command Palette (Ctrl/Cmd + Shift + P)
- Search for "Dev Containers: Rebuild Container"
- The
.env
file is gitignored and should never be committed - Each new release requires updating the version in
src/electionbuddy_python/__about__.py
- If you need to test the release process, consider using TestPyPI first