setuptools: [BUG] 71.0.0 fails with `backports.tarfile` on Python 3.8 when other backports imported
setuptools version
setuptools==71.0.0
Python version
Python 3.8
OS
Linux
Additional environment information
No response
Description
CI jobs started tripping when using setuptools 71, released two hours ago.
Expected behavior
CI builds work as expected.
How to Reproduce
No reproducer yet, but a stacktrace on GHA.
Output
ImportError: cannot import name 'tarfile' from 'backports'
(/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/backports/__init__.py)
– https://github.com/crate/cratedb-toolkit/actions/runs/9982521975/job/27589490156?pr=196#step:6:229
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 27 (12 by maintainers)
Commits related to this issue
- Reset the backports module when enabling vendored packages. Closes #4476 — committed to pypa/setuptools by jaraco 2 years ago
- Reset the backports module when enabling vendored packages. Closes #4476 — committed to pypa/setuptools by jaraco 2 years ago
- pin `setuptools>=71.0.3` Address error with `setuptools` and its dependencies. Relates to https://github.com/pypa/setuptools/issues/4476 — committed to crim-ca/weaver by fmigneault 2 years ago
- [fbgemm_gpu] Fix setuptools version - Fix setuptools version to be >= 71.0.3 to get the fix for https://github.com/pypa/setuptools/issues/4476 (affects Nova CI) — committed to q10/FBGEMM by q10 2 years ago
- [fbgemm_gpu] Fix setuptools version - Fix setuptools version to be >= 71.0.3 to get the fix for https://github.com/pypa/setuptools/issues/4476 (affects Nova CI) — committed to q10/FBGEMM by q10 2 years ago
- [fbgemm_gpu] Fix setuptools version - Fix setuptools version to be >= 71.0.3 to get the fix for https://github.com/pypa/setuptools/issues/4476 (affects Nova CI) — committed to q10/FBGEMM by q10 2 years ago
- Fix setuptools version (#2873) Summary: - Fix setuptools version to be >= 71.0.3 to get the fix for https://github.com/pypa/setuptools/issues/4476 (affects Nova CI) Pull Request resolved: https://gi... — committed to pytorch/FBGEMM by q10 2 years ago
- Fix setuptools version (#2873) Summary: - Fix setuptools version to be >= 71.0.3 to get the fix for https://github.com/pypa/setuptools/issues/4476 (affects Nova CI) Pull Request resolved: https://gi... — committed to pytorch/FBGEMM by q10 2 years ago
- [Requirements] Add google-cloud-bigquery-storage requirement to avoid running into an issue (https://github.com/pypa/setuptools/issues/4476) with setuptools [ML-7273](https://iguazio.atlassian.net/b... — committed to gtopper/mlrun by gtopper 2 years ago
I am also encountering this issue. Can reproduce it with the following packages installed:
and then running:
I faced a similar bug with python 3.10. It was fixed by downgrading to <70
Not sure what is happening, but with both 71.0.0 and 71.0.1 - my pytest flow stopped working
We use pyfilesystem2 - which is using pkg_resources internally and has the same issue:
pytest is failing here:
But note that - When I don’t use pytest - it works fine. When I do
venv38/bin/python -c "import fs"andvenv38/bin/python -c "import pkg_resources"- there is no error So, I am unclear how to make a Minimal Reproducible Example …Workarounds:
venv38/bin/pip install backports.tarfileA slightly longer stack trace from a python3.10 install:
pip install setuptools==69.0.0
If you’re still having the error on setuptools 71.0.4 or later, it’s a different root cause. Please open a new issue and importantly describe a reproducer (or at least more detail about your environment such that we might be able to reproduce it). Crucial will be to describe what other packages you have installed in the environment where the failure occurs.
@jaraco I can confirm that #4486 fixes the problem for me 😃
Is someone available to test if the PR in #4486 fixes the issue? Maybe
pip install git+https://github.com/pypa/setuptools@refs/pull/4486/head.