Setuptools 60 is breaking tests
See original GitHub issueFiled for tracking and discussion. Unfortuantely I don’t (and won’t for a while) have time to look into the cause, but from a quick peek, it seems like this is a debundling issue caused by setuptools’s distutils
~vendoring~ adoption:
self = <setuptools.command.egg_info.egg_info object at 0x000001ABC5892140>
dist = <setuptools.dist.Distribution object at 0x000001ABC58A0790>
def __init__(self, dist):
"""Create and initialize a new Command object. Most importantly,
invokes the 'initialize_options()' method, which is the real
initializer and depends on the actual command being
instantiated.
"""
# late import because of mutual dependence between these classes
from distutils.dist import Distribution
if not isinstance(dist, Distribution):
> raise TypeError("dist must be a Distribution instance")
E TypeError: dist must be a Distribution instance
Distribution = <class 'distutils.dist.Distribution'>
dist = <setuptools.dist.Distribution object at 0x000001ABC58A0790>
self = <setuptools.command.egg_info.egg_info object at 0x000001ABC5892140>
Setuptools is using isinstance
to check whether dist
is of the correct type, but it imports Distribution
from its vendored distutils
, which dist
is actually created from the system distutils. Or the other way around, I’m not sure. But something like that, I think. It’d be awesome if someone could dig deeper into this and file an issue in pypa/setuptools with deeper investigation.
Regarding pip’s situation, I think this does not affect the actual code base (which never imports setuptools), only the test suite, and we should be able to work around this by capping setuptools to <60
. Or with some workaround in test setup.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
It does not. This comes from setuptools directly (https://github.com/pypa/setuptools/tree/main/_distutils_hack), and this style of failure should likely be reported as a bug against setuptools or Debian (it might have already been reported, so please check for duplicates before filing a new one).
Just started updating
pip
to latest version and found that some new units are failing. I’m currentlysetuptools
60.9.3. Here is pytest output: