Skip to content

PyPi

This repository is used for storing python packages. The process of working with one of the twine package publishing tools is described below. To work with other tools, use their official documentation.

Depending on the working environment used, the commands may differ (python/python3, pip/pip3, etc.).

Setup package info (setup.py)

...
setuptools.setup(
    name="example-pkg-name",
...

Packaging

Before publishing the package, you must package it (make sure that you have the latest versions of setuptools and wheel installed):

$ pip install --user --upgrade setuptools wheel
$ python3 setup.py sdist bdist_wheel

After completion, two files must be generated in the dist directory:

dist/
    example-pkg-name-<version>-py3-none-any.whl
    example-pkg-name-<version>.tar.gz

Uploading

To publish the package to the repository, run (make sure that you have the twine module installed):

$ pip install --user --upgrade twine
$ twine upload -u username -p password --repository-url https://artifactory.$LOC.icdc.io/repository/ACC_NAME-pypi/ ./dist/*

Installing

To install a previously uploaded package from the repository run:

$ pip install --index-url https://artifactory.$LOC.icdc.io/repository/ACC_NAME-pypi/simple example-pkg-name