Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero' #4483

Closed
tim-s-ccs opened this issue Jul 18, 2024 · 36 comments

Comments

@tim-s-ccs
Copy link

setuptools version

setuptools>=71.0.0

Python version

Python 3.12

OS

Ubuntu

Additional environment information

I found this bug when running the test for the project in GitHub actions

Description

When I install the requirements in my Python package project (pip-sync requirements-dev.txt) I get an error within setuptools which says:

Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
...
TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

This error was caused by using setuptools >= 71.0.0

Not to speculate but it looks like the issue was introduced by this commit in setuptools: 00384a5

And this commit is including new changes from the packaging project and its this commit here where we can see the issue:
pypa/packaging@cc938f9
https://github.com/pypa/packaging/blame/4493dfcd95a893f676a7aa4bd17c547bea676371/src/packaging/utils.py#L58

Expected behavior

I would expect pip-sync requirements-dev.txt to run successfully

How to Reproduce

Clone https://github.com/tim-s-ccs/example-python-package.git
Make sure you are using Python 3.12 and you have pip-tools installed (pip install --upgrade pip wheel pip-tools)
Make sure you are using the correct version of setuptools pip install --upgrade setuptools==71.0.0
Run pip-compile requirements-dev.in

Output

    error: subprocess-exited-with-error
    
    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [42 lines of output]
        running egg_info
        creating /private/var/folders/kt/n16_msf56_z3kfyb65l37wxhb_m4s_/T/pip-pip-egg-info-3sca_19y/example_python_package.egg-info
        writing /private/var/folders/kt/n16_msf56_z3kfyb65l37wxhb_m4s_/T/pip-pip-egg-info-3sca_19y/example_python_package.egg-info/PKG-INFO
        writing dependency_links to /private/var/folders/kt/n16_msf56_z3kfyb65l37wxhb_m4s_/T/pip-pip-egg-info-3sca_19y/example_python_package.egg-info/dependency_links.txt
        writing top-level names to /private/var/folders/kt/n16_msf56_z3kfyb65l37wxhb_m4s_/T/pip-pip-egg-info-3sca_19y/example_python_package.egg-info/top_level.txt
        writing manifest file '/private/var/folders/kt/n16_msf56_z3kfyb65l37wxhb_m4s_/T/pip-pip-egg-info-3sca_19y/example_python_package.egg-info/SOURCES.txt'
        reading manifest file '/private/var/folders/kt/n16_msf56_z3kfyb65l37wxhb_m4s_/T/pip-pip-egg-info-3sca_19y/example_python_package.egg-info/SOURCES.txt'
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "/Users/my.name/Code/test/example-python-package/setup.py", line 16, in <module>
            setup(
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/__init__.py", line 106, in setup
            return distutils.core.setup(**attrs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
            return run_commands(dist)
                   ^^^^^^^^^^^^^^^^^^
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
            dist.run_commands()
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
            self.run_command(cmd)
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/dist.py", line 974, in run_command
            super().run_command(command)
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
            cmd_obj.run()
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run
            self.find_sources()
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
            mm.run()
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 555, in run
            self.prune_file_list()
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 621, in prune_file_list
            base_dir = self.distribution.get_fullname()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_core_metadata.py", line 266, in get_fullname
            return _distribution_fullname(self.get_name(), self.get_version())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_core_metadata.py", line 284, in _distribution_fullname
            canonicalize_version(version, strip_trailing_zero=False),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 64, in generate_metadata
    call_subprocess(
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py", line 209, in call_subprocess
    raise error
pip._internal.exceptions.InstallationSubprocessError: python setup.py egg_info exited with 1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/my.name/.pyenv/versions/3.12.2/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/piptools/scripts/compile.py", line 470, in cli
    results = resolver.resolve(max_rounds=max_rounds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/piptools/resolver.py", line 604, in resolve
    is_resolved = self._do_resolve(
                  ^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/piptools/resolver.py", line 636, in _do_resolve
    resolver.resolve(
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 76, in resolve
    collected = self.factory.collect_root_requirements(root_reqs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 538, in collect_root_requirements
    reqs = list(
           ^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 494, in _make_requirements_from_install_req
    cand = self._make_base_candidate_from_link(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 210, in _make_base_candidate_from_link
    self._editable_candidate_cache[link] = EditableCandidate(
                                           ^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 328, in __init__
    super().__init__(
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
    self.dist = self._prepare()
                ^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 235, in _prepare
    dist = self._prepare_distribution()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 338, in _prepare_distribution
    return self._factory.preparer.prepare_editable_requirement(self._ireq)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 698, in prepare_editable_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 72, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 69, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/req/req_install.py", line 580, in prepare_metadata
    self.metadata_directory = generate_metadata_legacy(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/my.name/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 71, in generate_metadata
    raise MetadataGenerationFailed(package_details=details) from error
pip._internal.exceptions.MetadataGenerationFailed: metadata generation failed
@tim-s-ccs tim-s-ccs added bug Needs Triage Issues that need to be evaluated for severity and status. labels Jul 18, 2024
@Kaflak
Copy link

Kaflak commented Jul 18, 2024

Issue is visible when you use packaging<22.0

@tonythomas01
Copy link

Could reproduce the same issue. Fixed by downgrading to 70.x

@Kaflak
Copy link

Kaflak commented Jul 18, 2024

Also it can be fixed by update packaging to 22.0 or higher

@jaraco
Copy link
Member

jaraco commented Jul 18, 2024

This behavior is by design. Similar to the issue reported in #4478, the new Setuptools 71 will prefer installed dependencies over the vendored ones. You'll want to either uninstall the older (incompatible) dependencies from the environment or install these dependencies. You may be tempted to install setuptools[core], but please avoid doing that as core is an internal implementation detail.

@mikealfare
Copy link

This behavior is by design. Similar to the issue reported in #4478, the new Setuptools 71 will prefer installed dependencies over the vendored ones. You'll want to either uninstall the older (incompatible) dependencies from the environment or install these dependencies. You may be tempted to install setuptools[core], but please avoid doing that as core is an internal implementation detail.

Just to confirm, we're seeing this happen in this environment:

python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine check-wheel-contents

Is that correct? It sounds like you're saying the issue is old dependencies existing in the environment, but we should have the most current packages here.

@tim-s-ccs
Copy link
Author

Thanks @jaraco this was helpful. In my project where I was having the issue because on older version of packaging was a dependancy (not compatible with setuptools v71.0.0 or maybe earlier). Updating that dependancy did indeed fix the issue.

It's a bit annoying that the behaviour of setuptools changed which messed up my tests (which gets the latest version of setuptools when setting up) but that is very much my fault and not your teams.

Again, thanks for your comment as it helped my to understand the issue better and what the cause was.


For anyone who has a situation like me where my tests just started failing I'd check to make sure your dependancies and the dependancies of setuptools are compatible.

@mikealfare
Copy link

Thanks @jaraco this was helpful. In my project where I was having the issue because on older version of packaging was a dependancy (not compatible with setuptools v71.0.0 or maybe earlier). Updating that dependancy did indeed fix the issue.

It's a bit annoying that the behaviour of setuptools changed which messed up my tests (which gets the latest version of setuptools when setting up) but that is very much my fault and not your teams.

Again, thanks for your comment as it helped my to understand the issue better and what the cause was.

For anyone who has a situation like me where my tests just started failing I'd check to make sure your dependancies and the dependancies of setuptools are compatible.

Thanks for posting your solution. I'm trying to reason through how we're running into the same issue. We're not specifying packaging anywhere, so I would assume we would get the most current version. And when I install locally, I get the same version of packaging you specify in your PR. Perhaps the CI image I'm using already has packaging installed, but with an older version? I'll investigate and post back if I find something. But it would definitely be a sharp corner if pip install --upgrade setuptools no longer works on ubuntu-latest.

webknjaz added a commit to webknjaz/ansible that referenced this issue Jul 18, 2024
This is now necessary since `setuptools >= 71` started preferring
externally present stdlib deps over the vendored ones.

Refs:
* pypa/setuptools#4457
* pypa/setuptools#4483
* pypa/setuptools#2825
@jaraco
Copy link
Member

jaraco commented Jul 18, 2024

Perhaps the CI image I'm using already has packaging installed, but with an older version?

Yes, probably.

Thanks for posting your solution. I'm trying to reason through how we're running into the same issue. We're not specifying packaging anywhere, so I would assume we would get the most current version. And when I install locally, I get the same version of packaging you specify in your PR. Perhaps the CI image I'm using already has packaging installed, but with an older version? I'll investigate and post back if I find something. But it would definitely be a sharp corner if pip install --upgrade setuptools no longer works on ubuntu-latest.

Agreed, it is a bit of a sharp corner, and we made the major release as a signal of this shift in expectations. The issue is that while you're holding it correctly and pip install -U setuptools should theoretically upgrade all the required dependencies, it cannot currently due to the bootstrapping problem. I'm actively working on solving that issue, but in the meantime, one needs to pip install -U setuptools[core] to prepare an environment safely.

You may be tempted to install setuptools[core], but please avoid doing that as core is an internal implementation detail.

I think I may have been too cautious about this advice. We specifically want to avoid packages themselves making this declaration in build-requires. I believe it's safe to use in systems integration tooling.

@mikealfare
Copy link

@jaraco Thanks for taking the time to respond. This advice is super useful:

You may be tempted to install setuptools[core], but please avoid doing that as core is an internal implementation detail.

I think I may have been too cautious about this advice. We specifically want to avoid packages themselves making this declaration in build-requires. I believe it's safe to use in systems integration tooling.

The issue that we wound up running into is that older versions of our package actually take a runtime dependency on packaging. Upon verifying the package (by installing it), the version of packaging was getting clobbered. This was only causing an issue for the sdist, and not the wheel.

bennahugo added a commit to ratt-ru/tigger-lsm that referenced this issue Nov 29, 2024
* Upgrade astlib for Python>-3.12.

* Move test matrix to newer python versions.

* Restrict numpy version on older Python versions

* Work around upstream breakage due to pypa/setuptools#4483

---------

Co-authored-by: Benjamin Hugo <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 2, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/swtpm that referenced this issue Dec 3, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
github-merge-queue bot pushed a commit to openvinotoolkit/openvino that referenced this issue Dec 4, 2024
### Details:
- `packaging` is a dependency of `setuptools`. When installed with
version lower than 22.0 it results in `TypeError: canonicalize_version()
got an unexpected keyword argument 'strip_trailing_zero'` when building
wheel. `setuptools` claims it's an expected behavior, does not enforce
that constraint and recommends to add the constraint ourselves. More
information: pypa/setuptools#4483
- `ImportError: cannot import name 'splat' from 'jaraco.functools'` has
been fixed in `setuptools==75.4.0`. More information:
pypa/setuptools@8d518af
- `Failed to detect ABI Tag via setuptools.command.bdist_wheel` - the
functionality has been added in `setuptools==70.1.0`, that's where the
new lower bound comes from. More context:
https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/wheel/CMakeLists.txt#L15

### Tickets:
 - CVS-157981

---------

Signed-off-by: p-wysocki <[email protected]>
github-merge-queue bot pushed a commit to openvinotoolkit/openvino that referenced this issue Dec 4, 2024
### Details:
- `packaging` is a dependency of `setuptools`. When installed with
version lower than 22.0 it results in `TypeError: canonicalize_version()
got an unexpected keyword argument 'strip_trailing_zero'` when building
wheel. `setuptools` claims it's an expected behavior, does not enforce
that constraint and recommends to add the constraint ourselves. More
information: pypa/setuptools#4483
- `ImportError: cannot import name 'splat' from 'jaraco.functools'` has
been fixed in `setuptools==75.4.0`. More information:
pypa/setuptools@8d518af
- `Failed to detect ABI Tag via setuptools.command.bdist_wheel` - the
functionality has been added in `setuptools==70.1.0`, that's where the
new lower bound comes from. More context:
https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/wheel/CMakeLists.txt#L15

### Tickets:
 - CVS-157981

---------

Signed-off-by: p-wysocki <[email protected]>
github-merge-queue bot pushed a commit to openvinotoolkit/openvino that referenced this issue Dec 4, 2024
### Details:
- `packaging` is a dependency of `setuptools`. When installed with
version lower than 22.0 it results in `TypeError: canonicalize_version()
got an unexpected keyword argument 'strip_trailing_zero'` when building
wheel. `setuptools` claims it's an expected behavior, does not enforce
that constraint and recommends to add the constraint ourselves. More
information: pypa/setuptools#4483
- `ImportError: cannot import name 'splat' from 'jaraco.functools'` has
been fixed in `setuptools==75.4.0`. More information:
pypa/setuptools@8d518af
- `Failed to detect ABI Tag via setuptools.command.bdist_wheel` - the
functionality has been added in `setuptools==70.1.0`, that's where the
new lower bound comes from. More context:
https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/wheel/CMakeLists.txt#L15

### Tickets:
 - CVS-157981

---------

Signed-off-by: p-wysocki <[email protected]>
openstack-mirroring pushed a commit to openstack/cinder that referenced this issue Dec 4, 2024
py39 jobs (on ubuntu-focal) started to fail due to recent virtualenv
release (20.26.4) on Yoga (which bundles setuptools), because we have
'packaging==21.3' in this branch that is not compatible with newer
setuptools [1].

setuptools is bundled in virtualenv, so it has to be capped via the
virtualenv package. tox also needed to be capped (<4) as gate uses
tox 3.28.0, but with capping virtualenv we pull in latest tox as well,
which would cause other errors.

[1] pypa/setuptools#4483

Change-Id: Ibbfef10e65d4acea6dd4e9f8a4fb3a4bcc877549
openstack-mirroring pushed a commit to openstack/devstack that referenced this issue Dec 4, 2024
Under as-yet-unidentified conditions, we can end up with a version of
packaging that is too old for the version of latest version of
setuptools. This is a known issue and expected behavior and per [1]
$subject is the preferred resolution.

[1] pypa/setuptools#4483 (comment)

Change-Id: I9232f3fae1598297e83c4ea37339896f7dcbd44f
Signed-off-by: Stephen Finucane <[email protected]>
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Dec 4, 2024
* Update devstack from branch 'master'
  to 320c2bf42ae41d751c72d80a6c85b26f3f6951bd
  - Install setuptools 'core' extra
    
    Under as-yet-unidentified conditions, we can end up with a version of
    packaging that is too old for the version of latest version of
    setuptools. This is a known issue and expected behavior and per [1]
    $subject is the preferred resolution.
    
    [1] pypa/setuptools#4483 (comment)
    
    Change-Id: I9232f3fae1598297e83c4ea37339896f7dcbd44f
    Signed-off-by: Stephen Finucane <[email protected]>
stefanberger added a commit to stefanberger/libtpms that referenced this issue Dec 6, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/libtpms that referenced this issue Dec 6, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/libtpms that referenced this issue Dec 6, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
stefanberger added a commit to stefanberger/libtpms that referenced this issue Dec 6, 2024
There seems to be a well known error in setuptools 71.x that prevents
installation of cpp-coveralls on Travis now:

File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname

    canonicalize_version(version, strip_trailing_zero=False),

TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'

Fall back to the default version that is used in Ubuntu Jammy (59.6.0)
since later versions also lead to the same error.

Link: pypa/setuptools#4483
Signed-off-by: Stefan Berger <[email protected]>
openstack-mirroring pushed a commit to openstack/devstack that referenced this issue Dec 10, 2024
Under as-yet-unidentified conditions, we can end up with a version of
packaging that is too old for the version of latest version of
setuptools. This is a known issue and expected behavior and per [1]
$subject is the preferred resolution.

[1] pypa/setuptools#4483 (comment)

Change-Id: I9232f3fae1598297e83c4ea37339896f7dcbd44f
Signed-off-by: Stephen Finucane <[email protected]>
(cherry picked from commit 320c2bf)
dleviminzi added a commit to beam-cloud/beta9 that referenced this issue Dec 11, 2024
… 12 (#776)

Resolve BE-2112

This seems to be a breaking change made to the setuptools library and
the maintainer does not seem likely to fix it.
pypa/setuptools#4483

It feels bad to be pinning an old version, but for now that seems to be
the best way of mitigating this problem.
openstack-mirroring pushed a commit to openstack/heat that referenced this issue Dec 13, 2024
This is a combination of four patch to fix the gate:

1. Use compatible version of heat-tempest-plugin

heat-tempest-plugin dropped py38 support, hence it cannot be installed
from recent master, so we need to override the checkout to the version
that still supports py38 and compatible to the actual branch.

This is needed both for the grenade job and the functional job, because
these are using the heat-tempest-plugin.

2. Try archive path to download Fedora image

This is a temporal workaround to allow downloading Fedora 37 image
which was moved to the archive path.

3. Remove reference to devstack-gate

devstack-gate was deprecated in xena and is being retired now[1].

4. [stable-only] Cap setuptools <71.0.0

py39 jobs (on ubuntu-focal) started to fail due to recent virtualenv
release (20.26.4) on Yoga (which bundles setuptools), because we have
'packaging==21.3' in this branch that is not compatible with newer
setuptools [2].

setuptools is bundled in virtualenv, so it has to be capped via the
virtualenv package. tox also needed to be capped (<4) as gate uses
tox 3.28.0, but with capping virtualenv we pull in latest tox as well,
which would cause other errors.

[1] https://review.opendev.org/c/openstack/governance/+/919629
[2] pypa/setuptools#4483

Changes:
  .zuul.yaml

NOTE(elod.illes): change in .zuul.yaml is to adapt the patch to the
current branch ('<series>-last' needs to be used).

Change-Id: I9b1702749976a2cea42a24130e5fec2931b75ce1
(cherry picked from commit a806b40)
(cherry picked from commit ae62258)
(cherry picked from commit 4fd9953)
(cherry picked from commit 81a8b93)
(cherry picked from commit 665ccfc)
(cherry picked from commit c18b344)
openstack-mirroring pushed a commit to openstack/heat that referenced this issue Dec 15, 2024
This is a combination of five patch to fix the gate:

1. Use compatible version of heat-tempest-plugin

heat-tempest-plugin dropped py38 support, hence it cannot be installed
from recent master, so we need to override the checkout to the version
that still supports py38 and compatible to the actual branch.

This is needed both for the grenade job and the functional job, because
these are using the heat-tempest-plugin.

2. Try archive path to download Fedora image

This is a temporal workaround to allow downloading Fedora 37 image
which was moved to the archive path.

3. Remove reference to devstack-gate

devstack-gate was deprecated in xena and is being retired now[1].

4. [stable-only] Cap setuptools <71.0.0

py39 jobs (on ubuntu-focal) started to fail due to recent virtualenv
release (20.26.4) on Yoga (which bundles setuptools), because we have
'packaging==21.3' in this branch that is not compatible with newer
setuptools [2].

setuptools is bundled in virtualenv, so it has to be capped via the
virtualenv package. tox also needed to be capped (<4) as gate uses
tox 3.28.0, but with capping virtualenv we pull in latest tox as well,
which would cause other errors.

5. Set functional jobs as non-voting

heat-functional jobs try to install python-zaqarclient (via zaqar
project) from master branch, but on master the client dropped py38
support, hence the jobs fail. This patch sets it non-voting as a
quick workaround until a final fix arrives.

[1] https://review.opendev.org/c/openstack/governance/+/919629
[2] pypa/setuptools#4483

Changes:
  .zuul.yaml

NOTE(elod.illes): change in .zuul.yaml is to adapt the patch to the
current branch ('<series>-last' needs to be used).

Change-Id: I9b1702749976a2cea42a24130e5fec2931b75ce1
(cherry picked from commit a806b40)
(cherry picked from commit ae62258)
(cherry picked from commit 4fd9953)
(cherry picked from commit 81a8b93)
(cherry picked from commit 665ccfc)
(cherry picked from commit c18b344)
(cherry picked from commit dcf7403)
coldfix added a commit to hibtc/cpymad that referenced this issue Dec 15, 2024
Fixes "TypeError: canonicalize_version() got an unexpected keyword
argument 'strip_trailing_zero'"

See e.g.:
    pypa/setuptools#4483
    pypa/setuptools#4501
coldfix added a commit to hibtc/cpymad that referenced this issue Dec 17, 2024
Fixes "TypeError: canonicalize_version() got an unexpected keyword
argument 'strip_trailing_zero'"

See e.g.:
    pypa/setuptools#4483
    pypa/setuptools#4501
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests