Skip to content

Latest commit

 

History

History
101 lines (68 loc) · 1.97 KB

File metadata and controls

101 lines (68 loc) · 1.97 KB

Building bsp_tool

Clean

$ 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

Build

$ python -m pip install --upgrade pip
$ python -m pip install --upgrade build
$ python -m build

build will install build-backend automatically running build with no arguments will generate both sdist & wheel

Check

Source Distribution

$ tar -tf dist/*.tar.gz

Should contain:12

  • bsp_tool/
  • tests/
  • pyproject.toml
  • README.md
  • CHANGELOG.md

pyproject.toml lists pytest & pytest-cov as optional dependencies pytest can also be configured in pyproject.toml under tool.pytest.ini_options

Wheel

$ unzip -l dist/*.whl

tests/ & docs/ should be absent

Upload

$ 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-SuperSecretAndVeryLongBase64TestPyPiAPIKey

API keys can be limited to a single repository you can add an entry into ~/.pypirc for this, but it's more complex not gonna explain that here

TestPyPI

add rc1 to version in pyproject.toml first! 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_tool

might have to wait a second for the latest version to upload

PyPI

$ twine upload dist/*

Footnotes

  1. Python Packaging User Guide: Package Formats

  2. Python distutils docs: Specifying the files to distribute