Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #16626

Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema generator

Path csiph.com!weretis.net!feeder8.news.weretis.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Simon Josefsson <simon@josefsson.org>
Newsgroups linux.debian.maint.python
Subject Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema generator
Date Thu, 26 Dec 2024 01:30:01 +0100
Message-ID <JXJVf-2DHD-3@gated-at.bofh.it> (permalink)
References <JXJVf-2DHD-5@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Thu Dec 26 00:24:05 2024
Old-Return-Path <simon@josefsson.org>
X-Amavis-Spam-Status No, score=-14.4 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FOURLA=0.1, LDO_WHITELIST=-5, PGPSIGNATURE=-5, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -4.6
X-Hashcash 1:23:241226:debian-python@lists.debian.org::4c5/HucSQQXXFXX/:iFj/
Openpgp id=B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE; url=https://josefsson.org/key-20190320.txt
X-Hashcash 1:23:241226:1091197@bugs.debian.org::E0MOA/+SLhQk6nt+:1iZr
X-Hashcash 1:23:241226:submit@bugs.debian.org::tYjKmmXAEl/YvG5+:0oPO+
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version 1.0
Content-Type multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
X-Mailing-List <debian-python@lists.debian.org> archive/latest/22720
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/87o70zwauh.fsf@kaka.sjd.se
Approved robomod@news.nic.it
Lines 121
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Thu, 26 Dec 2024 01:23:50 +0100
X-Original-Message-ID <87o70zwauh.fsf@kaka.sjd.se>
X-Original-References <87jzbqsjq4.fsf__16847.3339335591$1734954690$gmane$org@kaka.sjd.se>
Xref csiph.com linux.debian.maint.python:16626

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.debian.maint.python | Previous | NextNext in thread | Find similar


Thread

Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Simon Josefsson <simon@josefsson.org> - 2024-12-26 01:30 +0100
  Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Andrey Rakhmatullin <wrar@debian.org> - 2024-12-26 08:10 +0100
    Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Simon Josefsson <simon@josefsson.org> - 2024-12-26 12:10 +0100
      Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Andrey Rakhmatullin <wrar@debian.org> - 2024-12-26 13:00 +0100
        Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Simon Josefsson <simon@josefsson.org> - 2024-12-26 13:50 +0100
        Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Simon Josefsson <simon@josefsson.org> - 2025-01-27 11:20 +0100
          Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Carsten Schoenert <c.schoenert@t-online.de> - 2025-01-27 15:10 +0100
          Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Dmitry Shachnev <mitya57@debian.org> - 2025-01-27 15:20 +0100
  Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Carsten Schoenert <c.schoenert@t-online.de> - 2024-12-26 08:50 +0100
  Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Carsten Schoenert <c.schoenert@t-online.de> - 2024-12-26 08:50 +0100
    Re: Bug#1091197: ITP: python-genson -- user-friendly JSON Schema  generator Simon Josefsson <simon@josefsson.org> - 2024-12-26 12:50 +0100

csiph-web