Building Debian Python Package with Poetry

I try to build a debian package from the python package python-pam.

I followed mostly this gist.

Because the description is based on setup.py, but python-pam is based on pyproject.toml I tried to combine the information of this question: How to create a deb package for a python project without setup.py

I updated my control file to:

Source: python-pam
Section: python
Priority: optional
Maintainer: username <[email protected]>
Uploaders:
  username <[email protected]>
Build-Depends:
  debhelper-compat (= 13),
  dh-python,
  python3-all,
  pybuild-plugin-pyproject,
  python3-poetry-core,
Standards-Version: 4.5.1
Homepage: https://pypi.org/project/python-pam/
Rules-Requires-Root: no
Vcs-Git: https://github.com/FirefighterBlu3/python-pam.git
Vcs-Browser: https://github.com/FirefighterBlu3/python-pam
X-Python3-Version: >= 3.7

Package: python3-python-pam
Architecture: all
Multi-Arch: foreign
Depends:
  python3-six,
  ${misc:Depends},
  ${python3:Depends}
Description: python-pam for authentication in python
  Python pam module supporting py3 (and py2) for Linux type systems (!windows)

and reduced the rules to the following minimal:

#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
#export DH_VERBOSE = 1

%:
    dh $@ --with python3 --buildsystem=pybuild

If I try to run:

gbp buildpackage --git-pristine-tar

I’ve got an error about my ssh-key which I used to sign the tag previous isn’t bound to my user name. I might be able to figure this out by myself, but I struggle with my simple rules file.

So far as I understand, the rules describes the steps necessary to build the package. I used poetry in the past, but only for building Pypi-Packages. At this point I am not sure how to continue the rules file or, what else I might miss. The json package mentioned in the other question seems to at lot of other stuff, which python-pam doesn’t provide.

  • You are missing a comma between the package names, Voting to close as trivial typo. (You have a similar error in the Depends: of the package.)

    – 




  • You are absolutely right. Yesterday on ubuntu22.04 I did it correctly. But failed because of the missing poetry package. I the minimal approach for rules correct? I am not sure how the dpb is able to differentiate between setup.py and poetry.

    – 

  • Then probably edit your question to remove the spurious error and focus on the problem you really wanted to ask about. See also the help center and in particular How to ask as well as the guidance for providing a minimal reproducible example.

    – 

Leave a Comment