Subject: bug#49168: ‘guix import pypi’ misses package dependencies

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 25 Jun 2021 12:39:30 -0400

Hello,

Ludovic Courtès <[email-masked]> writes:

[...]

>> Perhaps it'd be best to raise the issue to the package maintainers and
>> have them specify their metadata correctly?
>
> Going back to the example at the beginning of this thread, what ‘guix
> import pypi tablib’ produces is missing ‘python-setuptools-scm’.
> Indeed, ‘METADATA’ doesn’t mention it.
>
> Is it really a bug on their side, or is it something peculiar about Guix
> packaging?  Perhaps ‘python-setuptools-scm’ should be provided more or
> less by default?

Hmm, sorry, I had lost track of what the original missing dependencies
were.  In this case (setuptools-scm), it is special in that it extends
the setuptools build system; it must be loaded early by setuptools, so
perhaps that explains why the dependency doesn't show as required in
METADATA.  I think going forward with the revised PEP 517 build system [0]
will alleviate such issues, by allowing to declare the build system and
its dependencies in a TOML file.

In the mean time, the statu quo seems the best option to me (manually
specify the setuptools extensions as native-inputs for the python
packages that need it).  We should look forward adjusting our importer
to the latest PEP 517 trends (along the PEP 517 build system patches
awaiting review for core-updates!), which are quickly becoming
ubiquitous in the Python world.

[0]  https://www.python.org/dev/peps/pep-0517/

HTH,

Maxim