Bug#1031716: Generating stricter dependencies on python3-protobuf rdeps

2023-03-27 Thread Pirate Praveen

On Tue, 7 Mar 2023 12:09:35 +0200 Adrian Bunk  wrote:
> 2. packages using python3-protobuf (e.g. python3-bernhard) ship files
>that were generated with protobuf-compiler during their build
>(e.g. /usr/lib/python3/dist-packages/bernhard/pb.py )

Can this generation be moved to postinst and use a dpkg trigger to 
regenerate it when protobuf is updated?


An example is 
https://sources.debian.org/src/node-constants-browserify/1.0.0%2Bdfsg-8/debian/postinst/


Though it would mean runtime dependency on protobuf-compiler.



Bug#1031716: Generating stricter dependencies on python3-protobuf rdeps

2023-03-07 Thread Stefano Rivera
Hi Adrian (2023.03.07_10:09:35_+)
> Creating an own debhelper addon similar to dh_numpy3 would work for 
> automatically creating such dependencies, but is there any way for
> python3-protobuf to inject such versioned runtime dependencies into
> python3:Depends that does not require every rdep to manually add
> addon usage?

Yes, via pydist files, see /usr/share/doc/dh-python/README.PyDist
They are consulted when translating Python .dist-info/.egg-info requires
into Debian dependencies.

You can see a (more complex) example in cffi:
https://salsa.debian.org/python-team/packages/python-cffi/-/blob/master/debian/gen-backend-versions.py

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272



Bug#1031716: Generating stricter dependencies on python3-protobuf rdeps

2023-03-07 Thread Adrian Bunk
Hi,

the problem in #1031716/#1028371 is as follows:

1. python3-protobuf and protobuf-compiler are both built from
   src:protobuf

2. packages using python3-protobuf (e.g. python3-bernhard) ship files 
   that were generated with protobuf-compiler during their build
   (e.g. /usr/lib/python3/dist-packages/bernhard/pb.py )

3. The generated files in python3-protobuf rdeps like python3-bernhard
   might not work with python3-protobuf from a different major release
   of src:protobuf

The manual solution for packages like python3-bernhard would be
Build-Depends: protobuf-compiler (>= 3.21), protobuf-compiler (<< 3.22),
   python3-protobuf (>= 3.21), python3-protobuf (<< 3.22),
Depends: python3-protobuf (>= 3.21), python3-protobuf (<< 3.22),

Creating an own debhelper addon similar to dh_numpy3 would work for 
automatically creating such dependencies, but is there any way for
python3-protobuf to inject such versioned runtime dependencies into
python3:Depends that does not require every rdep to manually add
addon usage?

Thanks
Adrian