ros-infrastructure / ros_release_python

3 stars 4 forks source link

Script to release Python packages used for ROS

Setup

The following dependencies need to be installed before being able to run the ros_release_python script:

Note: Make sure pip is for Python2, because sometimes when you install pip for Python3 (like on precise) it overwrites pip as pip for Python3. You can explicitly invoke pip from Python2 like this:

$ sudo python -c "from pkg_resources import load_entry_point; load_entry_point('pip', 'console_scripts', 'pip')()" install -U stdeb

Or with Python3 like this:

$ sudo python3 -c "from pkg_resources import load_entry_point; load_entry_point('pip', 'console_scripts', 'pip')()" install -U stdeb

Prepare a Python package

The Python package needs a stdeb.cfg file beside the setup.py file.

Release a Python package

Invoke scripts/ros_release_python in the root folder of the Python package to ensure that the packages can be built. If this succeeds invoke the same command with the --upload argument to actually push the packages to the servers.

Release a Python package only into new suites

Invoke scripts/ros_release_python --include --upload in the root folder of the Python package.

Releasing only python3 packages into new suites

As of stdeb 0.9.0 a Suite3 option is allowed in stdeb.cfg when building python2 and python3 packages separately as these scripts do. You can use this feature to prevent the release of python2 packages into new distributions where we do not support python2 (e.g. Ubuntu 20.04 Focal).

Releasing Python 2 packages targeting Ubuntu pre-Focal from Focal

As of stdeb 0.9.1 a Python2-Depends-Name option is allowed in stdeb.cfg to override the Python 2 package name. You can use this feature to force the Python 2 package name to be python rather than python2 as it is on Ubuntu Focal.

Sync into building / testing / main repos

This tool only uploads the generated Debian packages into the bootstrap repository. To make the packages available in the building / testing / main repos the Jenkins job to "import upstream" must be run.

Quick usage via rocker

If you have your ssh and pypi credentials available in your home directory.