-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Description
I am not sure if this new behaviour is welcome, but I am reporting it as an outcome of the investigation in pypa/setuptools#4902.
In pypa/setuptools#4902 I hypothesized that eagerly importing the command modules in command/__init__.py affected the end result of setuptools.monkey.patch_all:
- Previous to this PR the command modules were imported late, so by the time they were executed
distutils.core.Commandwas already monkeypatched tosetuptools.Command. - Now, the modules are executed before the patch.
The following experiment seems to corroborate this conclusion:
> docker run --rm -it python:3.10-bookworm /bin/bash
python -m pip install 'setuptools==77.0.1'
python
>>> import setuptools
>>> from distutils.command.sdist import sdist
>>> sdist.__mro__
(<class 'distutils.command.sdist.sdist'>, <class 'setuptools.Command'>, <class 'distutils.cmd.Command'>, <class 'object'>)
python -m pip install 'setuptools @ https://github.com/pypa/setuptools/archive/refs/tags/v77.0.2.zip'
# tag not published to PyPI.
python
>>> import setuptools
>>> from distutils.command.sdist import sdist
>>> sdist.__mro__
(<class 'distutils.command.sdist.sdist'>, <class 'distutils.cmd.Command'>, <class 'object'>)I don't know if there are the deeper unforeseen consequences of this change (other than problems similar to pypa/setuptools#4902).
Originally posted by @abravalheri in #345 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels