Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

Table of Contents


Preparatory activities

Info

Please note that these steps are not mandatory to proceed successfully, however they are considered good practice.

 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.

Markdown
### With necessary permissions
```console
$ module load itm-python
$ python3 -m pip install --upgrade pip
```

### Without necessary permissions
```console
$ 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:
```console
$ PATH=$HOME/.local/bin:$PATH
```