Make Releases

If you are developing a Python package containing colcon extensions you might want to make a release of it. Commonly that involves bumping the version number and tagging the commit with that version.

Commonly Python packages are released to PyPI following the packaging instructions for Python projects. For colcon packages the recommendation is to use publish-python which not only uploads a wheel to PyPI but also creates and uploads Debian packages.

First-time setup

Before using publish-python you need to do the following:

  • Install the prerequisites of publish-python
  • Configure credentials for twine / PyPI
  • Configure credentials for packagecloud.io and request to be added as a contributor to the colcon repository
  • Create a configuration file for your package

For details please see the publish-python documentation.

Example configuration file publish-python.yaml:

artifacts:
  - type: wheel
    uploads:
      - type: pypi
  - type: stdeb
    uploads:
      - type: packagecloud
        config:
          repository: dirk-thomas/colcon
          distributions:
            - ubuntu:xenial
            - ubuntu:bionic
            - ubuntu:focal
            - debian:stretch
            - debian:buster

The list of targeted distributions might need to be updated to match the configuration files mentioned in the following subsection.

Publishing a release

After having tagged the repository you only need to invoke publish-python --upload to create the configured artifacts as well as upload them to the configured destinations.

In the case the Debian package is used by the ROS community you need to open a ticket in the GitHub repository ros-infrastructure/reprepro-updater. The pull request should update the two files colcon.ubuntu.upstream.yaml and colcon.debian.upstream.yaml file with a bumped version number for the package. Someone from the ROS team will then review and merge the pull request and import the latest artifacts into the apt repositories of ROS.