$ rm -r *.egg-info/
$ rm -r build/
$ rm -r dist/NOTE:
build/dir is normally deleted automatically -- but it can stick around if a build is interrupted
$ python -m pip install --upgrade pip
$ python -m pip install --upgrade build
$ python -m buildbuild will install build-backend automatically
running build with no arguments will generate both sdist & wheel
$ tar -tf dist/*.tar.gzbsp_tool/tests/pyproject.tomlREADME.mdCHANGELOG.md
pyproject.tomllistspytest&pytest-covas optional dependenciespytestcan also be configured inpyproject.tomlundertool.pytest.ini_options
$ unzip -l dist/*.whltests/ & docs/ should be absent
$ python -m pip install --upgrade twine~/.pypirc can save API keys for the upload
[pypi]
username = __token__
password = pypi-SuperSecretAndVeryLongBase64PyPiAPIKey
[testpypi]
username = __token__
password = pypi-SuperSecretAndVeryLongBase64TestPyPiAPIKeyAPI keys can be limited to a single repository you can add an entry into
~/.pypircfor this, but it's more complex not gonna explain that here
add rc1 to
versioninpyproject.tomlfirst! helps us catch errors before the PyPI release
$ twine upload --repository testpypi dist/*Then, in another folder / virtual environment
$ python3 -m pip install --index-url https://test.pypi.org/simple/ bsp_toolmight have to wait a second for the latest version to upload
$ twine upload dist/*Footnotes
-
Python Packaging User Guide: Package Formats ↩
-
Python
distutilsdocs: Specifying the files to distribute ↩