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?
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$
$ 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)
Wasn't the proposed fix "export PYBUILD_NAME as the docs say"? I see you
are not doing this.
Andrey Rakhmatullin <wrar@debian.org> writes:
Wasn't the proposed fix "export PYBUILD_NAME as the docs say"? I see you are not doing this.
Thanks for reply! I added that but commented out since adding it did
not change the pybuild behaviour. The extra genson/schema/ files are
not built and installed, only the top-level genson/ directory which is
the case even without PYBUILD_NAME.
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.
+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/
You can simplify this all by using the variable PYBUILD_BEFORE_TEST
+export PYBUILD_BEFORE_TEST = cp -rv {dir}/genson/schema {build_dir}/$(PYBUILD_NAME)
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!
On Thu, Dec 26, 2024 at 12:03:51PM +0100, Simon Josefsson wrote:
Andrey Rakhmatullin <wrar@debian.org> writes:
Wasn't the proposed fix "export PYBUILD_NAME as the docs say"? I see you >> > are not doing this.
Thanks for reply! I added that but commented out since adding it did
not change the pybuild behaviour. The extra genson/schema/ files are
not built and installed, only the top-level genson/ directory which is
the case even without PYBUILD_NAME.
I've rechecked and the proposed fix also included "also, note the big fat warnings about upstream not configuring setuptools correctly".
As I've just checked, running `python3 -m build` in the upstream repo also produces a wheel without the schema subpackage.
Thanks for reply! I added that but commented out since adding it did
not change the pybuild behaviour. The extra genson/schema/ files are
not built and installed, only the top-level genson/ directory which is
the case even without PYBUILD_NAME.
I've rechecked and the proposed fix also included "also, note the big fat warnings about upstream not configuring setuptools correctly".
As I've just checked, running `python3 -m build` in the upstream repo also produces a wheel without the schema subpackage.
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.
Hi
Could someone help me and upstream how to get python setuptools to get
all files installed for this package?
Please see this thread and upstream bug report:
https://github.com/wolverdude/GenSON/issues/80
I work around the problem in the debian packaging like this:
export PYBUILD_BEFORE_TEST = \
cp -rv {dir}/genson/schema {build_dir}/$(PYBUILD_NAME)
However installing these files should be done by upstream setuptools
magic somehow. Some hint or ideally an upstream merge request to fix
this would be appreciated...
$ git diff
diff --git a/setup.cfg b/setup.cfg
index 3c9e75f..244f310 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -32,10 +32,12 @@ classifiers =
Topic :: Utilities
[options]
-packages = genson
zip_safe = True
include_package_data = True
+[options.packages.find]
+where=genson
+
[options.entry_points]
console_scripts = genson = genson.__main__:main
$ python3 -m build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools>=44
- wheel
* Getting build dependencies for sdist...
No `packages` or `py_modules` configuration, performing automatic discovery. `flat-layout` detected -- analysing .
discovered packages -- ['genson', 'genson.schema', 'genson.schema.strategies']
* Building sdist...
No `packages` or `py_modules` configuration, performing automatic discovery. `flat-layout` detected -- analysing .
discovered packages -- ['genson', 'genson.schema', 'genson.schema.strategies']
* Building wheel from sdist
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools>=44
- wheel
* Getting build dependencies for wheel...
No `packages` or `py_modules` configuration, performing automatic discovery. `flat-layout` detected -- analysing .
discovered packages -- ['genson', 'genson.schema', 'genson.schema.strategies']
* Building wheel...
No `packages` or `py_modules` configuration, performing automatic discovery. `flat-layout` detected -- analysing .
discovered packages -- ['genson', 'genson.schema', 'genson.schema.strategies']
Hi
Could someone help me and upstream how to get python setuptools to get
all files installed for this package?
Please see this thread and upstream bug report:
https://github.com/wolverdude/GenSON/issues/80
I work around the problem in the debian packaging like this:
export PYBUILD_BEFORE_TEST = \
cp -rv {dir}/genson/schema {build_dir}/$(PYBUILD_NAME)
However installing these files should be done by upstream setuptools
magic somehow. Some hint or ideally an upstream merge request to fix
this would be appreciated...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 481 |
Nodes: | 16 (2 / 14) |
Uptime: | 14:14:13 |
Calls: | 9,540 |
Calls today: | 8 |
Files: | 13,653 |
Messages: | 6,139,533 |
Posted today: | 1 |