[PATCH v2] tools: patman: fix `pip install` with Python 3.12
Brandon Maier
brandon.maier at collins.com
Mon Jul 1 19:51:41 CEST 2024
Installing patman with `cd ./tools/patman && pip install -e .` fails
with the error below.
As described in the error output below, the license line is not allowed
to be only defined in the setup.py. We remove the 'license' field
entirely, as the Python Packaging User Guide recommends using projects
classifiers instead[1] and we already set the GPL-2.0+ classifier.
> $ cd ./tools/patman && pip install -e .
> Obtaining file:///.../u-boot/tools/patman
> Installing build dependencies ... done
> Checking if build backend supports build_editable ... done
> Getting requirements to build editable ... error
> error: subprocess-exited-with-error
>
> × Getting requirements to build editable did not run successfully.
> │ exit code: 1
> ╰─> [61 lines of output]
> /tmp/pip-build-env-mqjvnmz8/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:76:
> _MissingDynamic: `license` defined outside of `pyproject.toml` is ignored.
> !!
>
> ********************************************************************************
> The following seems to be defined outside of `pyproject.toml`:
>
> `license = 'GPL-2.0+'`
>
> According to the spec (see the link below), however, setuptools CANNOT
> consider this value unless `license` is listed as `dynamic`.
>
> https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table
>
> To prevent this problem, you can list `license` under `dynamic` or alternatively
> remove the `[project]` table from your file and rely entirely on other means of
> configuration.
> ********************************************************************************
>
> !!
[1] https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
Signed-off-by: Brandon Maier <brandon.maier at collins.com>
---
Changes in v2:
- drop the license in favor of license classifiers
---
tools/patman/setup.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/patman/setup.py b/tools/patman/setup.py
index 2ff791da0f7..bcaad69a1c2 100644
--- a/tools/patman/setup.py
+++ b/tools/patman/setup.py
@@ -3,7 +3,6 @@
from setuptools import setup
setup(name='patman',
version='1.0',
- license='GPL-2.0+',
scripts=['patman'],
packages=['patman'],
package_dir={'patman': ''},
---
base-commit: 8937bb265a7f2251c1bd999784a4ef10e9c6080d
change-id: 20240701-python-3-12-fix-patman-license-51891e28b1f6
Best regards,
--
Brandon Maier <brandon.maier at collins.com>
More information about the U-Boot
mailing list