This tutorial covers releasing a Python distribution locally using GateWay as an example. It focuses on how to package a simple project in Python. It will show you how to add the necessary files and structure to create a package, how to build a package, and how to install it on any platform.
1. Preparatory activities
Please note that these steps are not mandatory to proceed successfully, however they are considered good practice.
1.1. PIP upgrade
Before any Python package activity, it is always a good move to upgrade your main Python package manager, such as PIP. This can be done from any location, however, sometimes the user is unable to do so due to file system permissions. In this case, it can be done for a local user using the --user
option on the command line.
This tutorial is based on using GateWay, therefore a Python module shall be loaded first.
1.1.1. With necessary permissions
$ module load itm-python
$ python3 -m pip install --upgrade pip
1.1.2. Without necessary permissions
$ module load itm-python
$ python3 -m pip install --upgrade pip --user
In that case it may be needed to add a local site-packages directory to $PATH:
$ PATH=$HOME/.local/bin:$PATH