17  Publishing Packages

17.1 Task : Publish a Python Package

17.1.1 Package “istec-p4

  • Use the package you created in the previous task and make it public.
  • Publish your package to the TestPyPi repository.
    • Navigate to https://test.pypi.org/ and Register yourself as an user.
  • This means your package will be available for everyone (worldwide) to install:

17.1.2 Using Package “istec-p4

  • Later, to install from TestPyPi you will issue this command:
pip install --index-url https://test.pypi.org/simple/ istec-p4
  • Later, to install from PyPi you will issue this command:
pip install istec-p4
  • Then you can load your package and call the existing functions within that package/module.
from istec.p4.exercises import greetings

# Calling the hello function
greetings.hello()
Note

The official Python packages repository is called PyPi (https://pypi.org/).