Hello Simon,

Am 26.12.24 um 02:23 schrieb Simon Josefsson:
Hi.  I'm struggling with packaging for this package:

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

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

on which base pybuild could make the right decision? pybuild is doing what it need and should do.

The missing installation of the subfolder looks to me like an upstream issue. If the folder is needed for later usage it needs to get installed by setuptools.

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$

You can simplify this all by using the variable PYBUILD_BEFORE_TEST

$ git diff debian/rules
diff --git a/debian/rules b/debian/rules
index a1954a9..77ab492 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,7 +2,9 @@
include /usr/share/dpkg/pkg-info.mk # DEB_VERSION -#export PYBUILD_NAME = genson
+export PYBUILD_NAME = genson
+export PYBUILD_BEFORE_TEST = cp -rv {dir}/genson/schema 
{build_dir}/$(PYBUILD_NAME)
+export PYBUILD_TEST_ARGS= -k 'not test_no_input'
%:
        dh $@ --buildsystem=pybuild
@@ -10,9 +12,6 @@ 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_after_dh_auto_install:
 ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
        mkdir -pv $(M)


And I personally would introduce another small package with just the binary genson. To mee it's totally fine it's serverd by the package python3-genson.
It's done very often within other Python binary packages.

And if you define and use own variables in the file d/rules please speaking namings. B and M are hard to read and for me using one character variable name is a bad habit.

I would drop them completely, they are used just one time!

--
Regards
Carsten Schönert

Reply via email to