Translation(s): none

This is a DRAFT!!!

This is a tutorial how to create a Debian package for Astropy Affiliated Packages. The tutorial consists of three parts:

  1. Preparation

  2. Packaging

  3. Advanced packaging and upload

2. Packaging

Previous page

3. Upload and advanced packaging


Only Debian Developers (DD) and Debian Maintainers (DM) can upload packages into the Debian repository. Debian Developers can also upload packages for others if they think that the package meets the Debian guidelines. This process is called "sponsoring".

The usual way to find a sponsor for you package is to file a bug against the "sponsorship-requests" pseudopackage. However, for packages that are maintained by the debian-astro team, there is a simpler approach: Just announce that you have the package ready in the debian-astro mailing list. We will quickly pick up your package from the git repository, review it and (if needed) discuss further changes. If the package is ready, we will upload it for you.

Documentation package

Automated testing

Automated tests can ensure that the package builds and works correctly. There are two different types of tests in Debian:

Build time tests are processed during the package build process. Usually, pybuild tries to find and run them automatically. You need, however, to specify the packages that are required for the test (f.e. python3-pytest) as additional build dependency.

If the tests are not found automatically, you can specify them manually in debian/rules:

PYTHON3:=$(shell py3versions -vr)

        for PYTHON in $(PYTHON3); do \
            PYTHONPATH=$$(pwd) python$$PYTHON test/ \
                || exit $$? ; \

Debian CI tests are processed whenever a dependency of the package changes. They are a good tool to make sure that the package will work when new versions of other packages are installed. These tests are specified in the directory debian/tests/. Basically, there is one script for each test, and a file debian/tests/control with the information about dependencies.

For wcsaxes, the file debian/tests/control is the following:

Test-Command: cd $AUTOPKGTEST_TMP && python3 -c 'import pytest, os, drms; exit(pytest.main(os.path.dirname(drms.__file__)))'
Depends: python3-drms, python3-pytest
Restrictions: allow-stderr

The [?DebianCi] page shows how this file is processed.


For some packages, the author may ask to cite a certain reference when referring to the package. These references are collected in a file upstream/metadata. The file format is described in UpstreamMetadata. This file also contains other information, like

As an example, the upstream/metadata from the python-cpl package is shown here:

ASCL-Id: 1612.001
 Author: Streicher, O., and Weilbacher, P. M. 
 Title: Python Bindings for the Common Pipeline Library 
 Journal: Astronomical Data Analysis Software and Systems XXI 
 Year: 2012 
 Volume: 461 
 Pages: 853 

Further responsibilities

See also

There is quite a lot documentation available that you can check for further information. The most important pages are

The policies describe the basic rules to follow when packaging: