Skip to content

Setuptools 60 is breaking tests #10742

@uranusjr

Description

@uranusjr

Filed 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions