Re: how to properly split up into python3-foo and foo-util package?
On Wed, Jul 12, 2023 at 02:21:48AM +0200, Christoph Anton Mitterer wrote:
<irrelevant details skipped>
> When I run debuild -us -uc on that, it generates:
> debian/tmp/...
> debian/tmp/usr/bin/<my console scripts>
> debian/tmp/usr/lib/python3.11/dist-packages/foo
> debian/tmp/usr/lib/python3.11/dist-packages/foo-1.0.0.dist-info
> debian/tmp/usr/lib/python3.11/dist-packages/foo-1.0.0.dist-info/LICENCE
>
> But then complains that the files aren't installed by anyone.
Yes, you usually need to use dh_install when having several subpackages.
This is not Python-specific.
> 1) Is there some mechanism in dh_python that would automatically split
> (respectively install) the files to the two packages, and I'm just
> to dumb to use it?
> Like that it knows, the Python package should likely go into the
> python3-* Debian package, and usr/bin stuff should likely go in the
> other?
I don't think there is, and I don't think "usr/bin stuff should likely go
in the other". Many Python module packages ship executables, especially
now that you no longer have Python 2 subpackages.
> 2) I then tried with such package.install files like those:
> foo-util.install:
> usr/bin
>
> python3-foo.install:
> usr/lib
>
> a) Why does it work to use just usr/... and not debian/tmp/usr/... ?
> Actually, both seems to work, which confuses me even more ^^
You can check the search logic in dh_install(1).
> b) What - if any - is the proper way here? Like I did, with one
> argument?
Yes, because the files are already installed into correct destinations.
> Or should one use the two arguments per line version?
> Or perhaps (for the 2nd file) rather usr/lib/python* ?
> Or rather the debian/tmp/usr/ path versions?
> Or using something completely different than dh_install?
No.
> 3) In debian/tmp, the subdir was /python3.11/ but in the final .deb
> file it's actually /python3/ (as I think it should be).
> Is it expected, that first it's /python3.11/ or am I doing anything
> wrong?
Yes, it's expected.
> 4) Are there way to have the Dependencies in control even more
> autodetected?
> a) That foo-util's dependency on python3-foo is somehow auto-filled
> by dh_python?
No, as there is no data to use here.
> b) Or the Build-Deps? I mean dh_python should at least be able to
> find out about python3-setuptools, python3-setuptools-scm from my
> pyproject.toml, shouldn't it?
You cannot autodetect build dependencies at the build time. That would be
too late.
> 5) Not really 100% Debian related, but in the Python sdist,... should
> that contain the debian/*?
No, and the upstream source shouldn't contain debian/ anyway, as the life
cycles of packaging and upstream sources should be separate even if the
person doing both is the same.
Reply to: