| Summary: | utils/scanpypi: fails with packages that define a package’s metadata in setup.cfg | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | Bartosz Bilas <bartosz.bilas> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED MOVED | ||
| Severity: | normal | CC: | buildroot, julian, kr886q, yann.morin.1998 |
| Priority: | P5 | ||
| Version: | 2020.08.2 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Bartosz Bilas
2020-11-18 19:02:24 UTC
I'm seeing something similar trying to make a package for python-debugpy. I have yet to find a workaround unless anyone has any suggestions? user@ubuntu:~/buildroot-2020.05.1$ python3 utils/scanpypi debugpy -o package utils/scanpypi:23: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp spdx_lookup module is not installed. This can lead to an inaccurate licence detection. Please install it via pip install spdx_lookup buildroot package name for debugpy: python-debugpy Package: python-debugpy Fetching package debugpy Downloading package debugpy from https://files.pythonhosted.org/packages/12/73/35e48dfeb1e26fbc6fe6e888c5b7507f7010488bb1d7363322edc38c03c6/debugpy-1.2.0.zip... Error: Could not install package debugpy: module 'setup' has no attribute 'main' To provide more background on this issue: this is the result of PEP-517 (https://www.python.org/dev/peps/pep-0517/) getting a wider adoption. According to the documentation: https://setuptools.readthedocs.io/en/latest/setuptools.html#id4 the recommended approach for Python packages is to define the dependencies decoratively in setup.cfg. The deprecated calls to setup.py remain backwards compatible by emulating a dummy setup.py with a setup() method call. In that case the method is called without any arguments, and this is ultimately the reason utils/scanpypi script fails for many packages that use this new approach. It seems to me that one possible solution to this would be to detect if the setup.cfg exists and retrieve the package's metadata from it (e.g. using the read_configuration method from setuptools.config). But I wonder if there exists a Python native solution to retrieve the metadata (including install_requires dependencies) from a Python package regardless whether PEP-517 convention is used or not, and more importantly, without installing that package. Does anyone know of such mechanism? Also if anyone found a working solution to this, I would very much appreciate if it can be shared. *** Bug 14321 has been marked as a duplicate of this bug. *** Thank you for your report.
The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
https://gitlab.com/buildroot.org/buildroot/-/issues
We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.
Thank you!
|