Skip to content

PyPI packing

Erik Jaegervall (Jägervall) edited this page Sep 19, 2024 · 8 revisions

General

vss-tools exist as PyPI package.

Owners

PyPI has their own accounts. At the moment two VSS maintainers are also PyPI owners for vss-tools:

  • Erik Jägervall
  • Sebastian Schildt
  • Paul Boyes

It is important to always have at least two owners, as adding users without being owner/maintainer is difficult or even impossible.

Upload packages

Version used is hardcoded in pyproject.toml. See Release Instruction for version number guidance.

To upload to main repository

# If not done before
pip install twine

git clean -fdx
python -m build
python -m twine upload dist/*

After the second step, verify that versions are reported as expected. It should look something like this if the intended version is 4.0rc2:

A lot of lines removed!

user@debian:~/vss-tools$ python -m build
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (setuptools, wheel)
* Getting build dependencies for sdist...
* Building sdist...
Creating tar archive
removing 'vss-tools-4.0rc2' (and everything under it)
* Installing packages in isolated environment... (wheel)
* Building wheel...
running bdist_wheel
running build
running build_py
running install
running install_lib
running install_scripts
removing build/bdist.linux-x86_64/wheel
Successfully built vss-tools-4.0rc2.tar.gz and vss_tools-4.0rc2-py3-none-any.whl
user@debian:~/vss-tools$ 

To upload to TestPyPI

git clean -fdx
python -m build
python -m twine upload --repository testpypi dist/*

To install released version from main repository:

pip install vss-tools

To install a pre-release you need to use --pre and possibly also give a version requirement to avoid finding a matching released version

pip install --pre  vss-tools>4.0

It is unlikely that test repo needs to be used, but if so you might need to specify also main repository as backup to be able to find dependencies.

As --pre is used you might need to also specify default repository to find dependencies like anytree.

python -m pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url  https://pypi.org/simple/ vss-tools

After installation, tools like vspec2x.py shall be available on your path without the need of cloning the repository. For development purposes you can install directly from source:

Local install

pip install -e .

Package Creation

Packages can be created if you have an account and a token. I.e. packages are up to grab if they do not yet exist

erik@debian3:~/vss-tools$ python -m twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading vss_tools-4.1.dev5-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.8/48.8 kB • 00:01 • 134.0 kB/s
Uploading vss-tools-4.1.dev5.tar.gz
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.5/42.5 kB • 00:00 • 82.3 MB/s

View at:
https://pypi.org/project/vss-tools/4.1.dev5/

PyPI reference image

image

TestPyPI reference image

https://test.pypi.org/manage/project/vss-tools/collaboration/ image