From Dogtag
Jump to: navigation, search

Creating PyPI Release

Prepare your system

Install package requirements

dnf install python-setuptools python-wheel

Store PyPI credentials in ~/.pypirc

index-servers =

username: <username>
password: <password>

Build and upload release to PyPI

Create the release with the following commands:

$ cd base/common/python
$ python release

To inspect the files before they are uploaded, do:

$ cd base/common/python
$ python packages
$ ls dist/

The packages and release aliases are defined in setup.cfg. It creates a source distribution and universal wheel. Then it registers a new version of the package and uploads both files to PyPI. A file can only uploaded once. PyPI refused to replace a file. gets the version and release from specs/pki-core.spec. The Python script rewrites itself to include the version number in and to make the source distribution work without specs/pki-core.spec. Please revert changes to afterwards.