Hi.  I'm struggling with packaging for this package:

https://salsa.debian.org/python-team/packages/python-genson

On the 'debian/latest' branch there is a "normal" packaging (except that
it ignore self-check errors), and there are two related problems:

https://salsa.debian.org/python-team/packages/python-genson/-/jobs/6818093

1) Self-checks cannot find the 'genson.schema' module.

E   ModuleNotFoundError: No module named 'genson.schema'

2) The resulting package doesn't have the genson/schema sub-directory:

jas@kaka:~/dpkg/python-genson$ curl --silent 
'https://salsa.debian.org/python-team/packages/python-genson/-/jobs/6818096/artifacts/raw/aptly/pool/main/p/python-genson/python3-genson_1.3.0-1+salsaci+20241226+4_all.deb'|dpkg
 -c -|grep dist-packages/genson/
drwxr-xr-x root/root         0 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/
-rw-r--r-- root/root       347 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/__init__.py
-rw-r--r-- root/root      5877 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/__main__.py
jas@kaka:~/dpkg/python-genson$ 

On the 'hack' branch I made a crude attempt at resolving this, and
indeed self-checks are happy, even autopkgtest, and the package contains
the sub-directory:

https://salsa.debian.org/python-team/packages/python-genson/-/pipelines/786628

jas@kaka:~/dpkg/python-genson$ curl --silent 
'https://salsa.debian.org/python-team/packages/python-genson/-/jobs/6818159/artifacts/raw/aptly/pool/main/p/python-genson/python3-genson_1.3.0-1+salsaci+20241226+6_all.deb'|dpkg
 -c -|grep dist-packages/genson/
drwxr-xr-x root/root         0 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/
-rw-r--r-- root/root       347 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/__init__.py
-rw-r--r-- root/root      5877 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/__main__.py
drwxr-xr-x root/root         0 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/
-rw-r--r-- root/root         0 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/__init__.py
-rw-r--r-- root/root      5423 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/builder.py
-rw-r--r-- root/root      4741 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/node.py
drwxr-xr-x root/root         0 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/strategies/
-rw-r--r-- root/root       522 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/strategies/__init__.py
-rw-r--r-- root/root      2109 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/strategies/array.py
-rw-r--r-- root/root      2196 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/strategies/base.py
-rw-r--r-- root/root      3276 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/strategies/object.py
-rw-r--r-- root/root      1891 2024-12-23 12:52 
./usr/lib/python3/dist-packages/genson/schema/strategies/scalar.py
jas@kaka:~/dpkg/python-genson$ 

But the patch is really ugly!  See below.  It copies files from the
source direcory into the pybuild internal path, including hard coded
version numbers.  Pybuild should have copied these files by itself.

Why doesn't pybuild do the right thing by default?

Any ideas how to resolve?

Feel free to clone the project and/or push to it to experiment.  I'll
take a little break from this package now...

jas@kaka:~/dpkg/python-genson$ git diff debian/latest..hack
diff --git a/debian/rules b/debian/rules
index a1954a9..1658f7b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,6 +3,7 @@
 include /usr/share/dpkg/pkg-info.mk # DEB_VERSION
 
 #export PYBUILD_NAME = genson
+export PYBUILD_TEST_ARGS= -k 'not test_no_input'
 
 %:
        dh $@ --buildsystem=pybuild
@@ -10,8 +11,9 @@ include /usr/share/dpkg/pkg-info.mk # DEB_VERSION
 B = $(CURDIR)/debian/tmp/usr/bin
 M = $(CURDIR)/debian/tmp/usr/share/man/man1
 
-override_dh_auto_test:
-       -dh_auto_test $(DH_BUILD_OPTS)
+execute_before_dh_auto_test:
+       cp -rv genson/schema .pybuild/cpython3_3.12/build/genson/
+       cp -rv genson/schema .pybuild/cpython3_3.13/build/genson/
 
 execute_after_dh_auto_install:
 ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
jas@kaka:~/dpkg/python-genson$ 

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to