-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
Issue is visible when you use packaging<22.0 |
Could reproduce the same issue. Fixed by downgrading to 70.x |
Also it can be fixed by update packaging to 22.0 or higher |
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. |
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. |
Thanks @jaraco this was helpful. In my project where I was having the issue because on older version of 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 |
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
Yes, probably.
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
I think I may have been too cautious about this advice. We specifically want to avoid packages themselves making this declaration in |
@jaraco Thanks for taking the time to respond. This advice is super useful:
The issue that we wound up running into is that older versions of our package actually take a runtime dependency on |
… 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.
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)
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)
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
py38 jobs (on ubuntu-focal) started to fail (see the relevant github issue [1]) due to recent virtualenv release (20.26.4; which bundles setuptools). 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: I7681e2457e44fc71dc6ea4c54ab92d39e7fa6db3
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
Fixes "TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'" See e.g.: pypa/setuptools#4483 pypa/setuptools#4501
… for known issue fixes pypa/setuptools#4483
… for known issue (#14) fixes pypa/setuptools#4483
Bump to 1.4.0 because of protobuf incompatibility Add 3.11-3.13 to tox and remove 3.6 and 3.7 Pin setuptools < 71.0.0 because of pypa/setuptools#4483
devstack-gate has been retired, remove it from the 'required-projects' section of job definitions. Also remove lower-constraints job as it is either not required anymore, nor is it passing. Plus incorporates the following patch as well to fix py38, cover and docs jobs: Cap setuptools <71.0.0 py38 jobs (on ubuntu-focal) started to fail (see the relevant github issue [1]) due to recent virtualenv release (20.26.4; which bundles setuptools). 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 Conflicts: .zuul.yaml NOTE(elod.illes): conflict is due to branch specific job settings. Change-Id: I4e2b33b19c6fd88add39d001e56b9ace09ac222d (cherry picked from commit 7ddebd6)
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. 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 tox.ini NOTE(elod.illes): change in .zuul.yaml is to adapt the patch to the current branch ('<series>-last' needs to be used). Also needed to remove grenade job as pre-victoria branches are all EOL. periodic-stable job template is unnecessary as well. setuptools needed to be capped as well to make >py36 based jobs pass. 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) (cherry picked from commit 21ed95f) (cherry picked from commit e742c31)
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. 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 tox.ini NOTE(elod.illes): change in .zuul.yaml is to adapt the patch to the current branch ('<series>-last' needs to be used). Another change is: tox.ini does not need the setuptools pinning here as we don't use py39 in wallaby branch. 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) (cherry picked from commit 21ed95f)
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: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 successfullyHow 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
The text was updated successfully, but these errors were encountered: