Skip to contentSkip to conversation

tools: patman: fix `pip install` with Python 3.12

PATCH Superseded Brandon Maier 2 participants 4 messages Jun 4, 2024 – Jul 1, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: patman: fix `pip install` with Python 3.12

Installing patman with cd ./tools/patman && pip install -e . fails with the error below.

As described in the error output, the license line is not allowed to be only defined in the setup.py.

Quoted 22 lines
$ 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.

Quoted 8 lines

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.
********************************************************************************

!!

---
 tools/patman/pyproject.toml | 1 +
 1 file changed, 1 insertion(+)
tools/patman/pyproject.toml +1 -0
index fcefcf66960..9e6079cb57e 100644
@@ -17,6 +17,7 @@ classifiers = [
     "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
     "Operating System :: OS Independent",
 ]
+dynamic = ["license"]
 
 [project.urls]
 "Homepage" = "https://docs.u-boot.org/en/latest/develop/patman.html"
Signature · 1 line
2.45.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 36 lines · Brandon Maier

Installing patman with cd ./tools/patman && pip install -e . fails with the error below.

As described in the error output, the license line is not allowed to be only defined in the setup.py.

Quoted 29 lines
$ 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.
********************************************************************************

Quoted 7 lines
Quoted 1 line
      !!
---
 tools/patman/pyproject.toml | 1 +
 1 file changed, 1 insertion(+)
#2 lore raw

Hi Brandon,

Quoted 40 lines · Simon Glass
Quoted 38 lines · Brandon Maier

Installing patman with cd ./tools/patman && pip install -e . fails with the error below.

As described in the error output, the license line is not allowed to be only defined in the setup.py.

Quoted 30 lines
$ 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.
********************************************************************************

!!

Quoted 7 lines
Quoted 5 lines
---
 tools/patman/pyproject.toml | 1 +
 1 file changed, 1 insertion(+)

Unfortunately this causes 'make pip' to fail. Can you please take a look?

Regards,
Simon

#3 lore raw

Hi Simon,

Quoted 49 lines · Simon Glass

Hi Brandon,

Quoted 46 lines · Simon Glass
Quoted 43 lines · Brandon Maier

Installing patman with cd ./tools/patman && pip install -e . fails with the error below.

As described in the error output, the license line is not allowed to be only defined in the setup.py.

Quoted 22 lines
$ 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.

Quoted 8 lines

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.
********************************************************************************

!!

---
 tools/patman/pyproject.toml | 1 +
 1 file changed, 1 insertion(+)
Quoted 3 lines
Quoted 1 line

Unfortunately this causes 'make pip' to fail. Can you please take a look?

The make pip uses python -m build which seems to handle this differently.

I removed the license line from setup.py entirely, as the pyproject doc says it's not needed if a license classifier is used. That now works with both pip install and python -m build.

Thanks,
Brandon

Quoted 3 lines

Regards,
Simon