Differences between revisions 11 and 12
Revision 11 as of 2019-11-13 16:24:30
Size: 4922
Comment: replace deprecated ADTTMP with AUTOPKGTEST_TMP
Revision 12 as of 2022-10-06 18:03:13
Size: 4870
Editor: ?OleStreicher
Comment:
Deletions are marked like this. Additions are marked like this.
Line 71: Line 71:
Contact: python-cpl@liska.ath.cx
Name: python-cpl

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

Upload

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, and
  • Debian CI tests

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)

override_dh_auto_test:
        for PYTHON in $(PYTHON3); do \
            PYTHONPATH=$$(pwd) python$$PYTHON test/TestRecipe.py \
                || exit $$? ; \
        done

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.

upstream/metadata

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

  • a git repository for upstream development,
  • where to submit bug reports upstream etc.

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

ASCL-Id: 1612.001
Reference: 
 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 
 URL: http://adsabs.harvard.edu/abs/2012ASPC..461..853S 
Repository: https://github.com/olebole/python-cpl

Further responsibilities

  • bug reports
  • reproducible builds


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:


CategoryPackaging