tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: py-setuptool update is coming



On Fri, 11 Apr 2025 at 20:40:40 +0200, Adam wrote:
> I am planning an update for py-setuptools to the latest version. There
> is a breaking change that affects all Python packages that build using
> setuptools and install a licence file - the file location changes to
> "${PYSITELIB}/${WHEEL_INFODIR}/licenses".
> 
> I have a script ready for updating such packages, and will fix the
> fallout as quickly as possible. Please, stay calm and let me know if I
> missed something.

Hi Adam,

It seems that py-setuptools has new runtime dependencies, from
examining its pyproject.toml definition, and from encountering this in
builds, e.g., in an environment that has py-packaging 24.1 installed:

===> Building for py312-markdown-3.8
* Building wheel...
Could not find an up-to-date installation of `packaging`. License
expressions might not be validated. To enforce validation, please
install `packaging>=24.2`.
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.12/site-
packages/pyproject_hooks/_in_process/_in_process.py", line 353, in
<module>
    main()
  File "/usr/pkg/lib/python3.12/site-
packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-
packages/pyproject_hooks/_in_process/_in_process.py", line 251, in
build_wheel
    return _build_backend().build_wheel(wheel_directory,
config_settings,
          
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/build_meta.py",
line 435, in build_wheel
    return _build(['bdist_wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/build_meta.py",
line 426, in _build
    return self._build_with_temp_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/build_meta.py",
line 407, in _build_with_temp_dir
    self.run_setup()
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/build_meta.py",
line 320, in run_setup
    exec(code, locals())
  File "<string>", line 1, in <module>
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/__init__.py",
line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-
packages/setuptools/_distutils/core.py", line 160, in setup
    dist.parse_config_files()
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/dist.py", line
756, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename,
ignore_option_errors)
  File "/usr/pkg/lib/python3.12/site-
packages/setuptools/config/pyprojecttoml.py", line 73, in
apply_configuration
    return _apply(dist, config, filepath)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-
packages/setuptools/config/_apply_pyprojecttoml.py", line 61, in apply
    dist._finalize_license_expression()
  File "/usr/pkg/lib/python3.12/site-packages/setuptools/dist.py", line
427, in _finalize_license_expression
    normalized = str_(_canonicalize_license_expression(license_expr))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-
packages/setuptools/_normalization.py", line 163, in
_missing_canonicalize_license_expression
    raise ImportError(
ImportError: Cannot import `packaging.licenses`.
        Setuptools>=77.0.0 requires "packaging>=24.2" to work properly.
        Please make sure you have a suitable version installed.
        
(I see other packages listed as Setuptools dependencies now, too.)

Regards,

Dave



Home | Main Index | Thread Index | Old Index