Package: https://pypi.org/project/pgsql-test/ Reference: https://packaging.python.org/en/latest/tutorials/packaging-projects/
The build backend is poetry-core (see pyproject.toml), but you do not need
Poetry installed to release. The standard build + twine tools work.
python3 -m pip install --upgrade build twineCreate a PyPI API token at https://pypi.org/manage/account/#api-tokens and put it
in ~/.pypirc:
[pypi]
username = __token__
password = pypi-...-
Bump
versioninpyproject.toml(PyPI will reject a re-upload of an existing version). -
Make sure CI is green on
main. -
Build and check:
rm -rf dist python3 -m build twine check dist/* -
Upload:
twine upload dist/* -
Tag and push:
git tag v$(python3 -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['tool']['poetry']['version'])") git push --tags
To do a dry run against TestPyPI first, add a [testpypi] section to ~/.pypirc
with a token from https://test.pypi.org and run
twine upload --repository testpypi dist/*.