You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_get_output_mapping_with_stub(self, tmpdir_cwd, monkeypatch):
monkeypatch.setenv('SETUPTOOLS_EXT_SUFFIX', '.mp3') # make test OS-independent>monkeypatch.setattr('setuptools.command.build_ext.use_stubs', True)
obj = <module 'setuptools.command' from '/home/runner/work/setuptools/setuptools/setuptools/command/__init__.py'>name = 'build_ext', ann = 'setuptools.command.build_ext' def annotated_getattr(obj: object, name: str, ann: str) -> object: try:
> obj = getattr(obj, name)E AttributeError: module 'setuptools.command' has no attribute 'build_ext'/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/monkeypatch.py:91: AttributeErrorThe above exception was the direct cause of the following exception:self = <setuptools.tests.test_build_ext.TestBuildExt object at 0x7f41b3f86a50>tmpdir_cwd = local('/home/runner/work/setuptools/setuptools')monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f41b1dfe5d0> def test_get_outputs(self, tmpdir_cwd, monkeypatch): monkeypatch.setenv('SETUPTOOLS_EXT_SUFFIX', '.mp3') # make test OS-independent
> monkeypatch.setattr('setuptools.command.build_ext.use_stubs', False)/home/runner/work/setuptools/setuptools/setuptools/tests/test_build_ext.py:109: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/monkeypatch.py:103: in derive_importpath target = resolve(module)/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/monkeypatch.py:[85](https://github.com/pypa/setuptools/actions/runs/8853717171/job/24315188999#step:9:86): in resolve found = annotated_getattr(found, part, used)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = <module 'setuptools.command' from '/home/runner/work/setuptools/setuptools/setuptools/command/__init__.py'>name = 'build_ext', ann = 'setuptools.command.build_ext' def annotated_getattr(obj: object, name: str, ann: str) -> object: try: obj = getattr(obj, name) except AttributeError as e:
> raise AttributeError( f"{type(obj).__name__!r} object at {ann} has no attribute {name!r}" ) from eE AttributeError: 'module' object at setuptools.command.build_ext has no attribute 'build_ext'/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/monkeypatch.py:[93](https://github.com/pypa/setuptools/actions/runs/8853717171/job/24315188999#step:9:94): AttributeError
Because:
setuptools.command.build_ext is defined as a module, not an attribute of setuptools.command
setuptools.command.build_ext module does define a build_ext class. But also setuptools.command.build_ext.build_ext should have nothing to do with monkeypatching setuptools.command.build_ext.use_stubs...
Prior to 8.1.2 the following statement executed without raising an exception (8.0.2) in the setuptools CI, but now it started failing (8.1.2):
/home/runner/work/setuptools/setuptools/setuptools/tests/test_build_ext.py:141
The error message does not make much sense to me:
Because:
setuptools.command.build_ext
is defined as a module, not an attribute ofsetuptools.command
setuptools.command.build_ext
module does define abuild_ext
class. But alsosetuptools.command.build_ext.build_ext
should have nothing to do with monkeypatchingsetuptools.command.build_ext.use_stubs
...In the same workflow run, we also have other similar errors (e.g.
AttributeError: module 'setuptools.command' has no attribute 'build_clib'
)- [x] output of `pip list` from the virtual environment you are using
For the tox output:
Unfortunately I was not able to simplify the reproducer.
I tried to create a minimal example with
monkeypatch
and nested modules but all works fine:The text was updated successfully, but these errors were encountered: