Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest setuptools setuptools==71.0.1 broke pytest #12629

Closed
otrejo-soria opened this issue Jul 18, 2024 · 3 comments
Closed

Latest setuptools setuptools==71.0.1 broke pytest #12629

otrejo-soria opened this issue Jul 18, 2024 · 3 comments

Comments

@otrejo-soria
Copy link

otrejo-soria commented Jul 18, 2024

Not sure if this will be right place to file it, but since it seems to happen with pytest, I am filing it here.

platform win32 -- Python 3.10.8, pytest-8.2.1, pluggy-1.5.0 -- C:\myrepo\venv\Scripts\python.exe
cachedir: .pytest_cache
metadata: {'Python': '3.10.8', 'Platform': 'Windows-10-10.0.19045-SP0', 'Packages': {'pytest': '8.2.1', 'pluggy': '1.5.0'}, 'Plugins': {'pti': '2.1.912', 'html': '4.1.1', 'metadata': '3.1.1', 'rerunfailures': '14.0', 'timeout': '2.3.1', 'xdist': '3.6.1'}, 'JAVA_HOME': 'C:\\Program Files\\Java\\jdk1.8.0_172'}
rootdir: C:\myrepo
configfile: pytest.ini
plugins: pti-2.1.912, html-4.1.1, metadata-3.1.1, rerunfailures-14.0, timeout-2.3.1, xdist-3.6.1
initialized: 4/4 workers[gw0] node down: Traceback (most recent call last):
  File "C:\myrepo\venv\lib\site-packages\execnet\gateway_base.py", line 1291, in executetask
    exec(co, loc)
  File "C:\myrepo\venv\lib\site-packages\xdist\remote.py", line 386, in <module>
    config = _prepareconfig(args, None)
  File "C:\myrepo\venv\lib\site-packages\_pytest\config\__init__.py", line 346, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "C:\myrepo\venv\lib\site-packages\pluggy\_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "C:\myrepo\venv\lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "C:\myrepo\venv\lib\site-packages\pluggy\_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "C:\myrepo\venv\lib\site-packages\pluggy\_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
  File "C:\myrepo\venv\lib\site-packages\_pytest\helpconfig.py", line 106, in pytest_cmdline_parse
    config = yield
  File "C:\myrepo\venv\lib\site-packages\pluggy\_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "C:\myrepo\venv\lib\site-packages\_pytest\config\__init__.py", line 1152, in pytest_cmdline_parse
    self.parse(args)
  File "C:\myrepo\venv\lib\site-packages\_pytest\config\__init__.py", line 1501, in parse
    self._preparse(args, addopts=addopts)
  File "C:\myrepo\venv\lib\site-packages\_pytest\config\__init__.py", line 1388, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "C:\myrepo\venv\lib\site-packages\pluggy\_manager.py", line 421, in load_setuptools_entrypoints
    plugin = ep.load()
  File "C:\Python310\lib\importlib\metadata\__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "C:\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\myrepo\venv\lib\site-packages\setuptools\_vendor\typeguard\__init__.py", line 21, in <module>
    from ._importhook import ImportHookManager as ImportHookManager
  File "C:\myrepo\venv\lib\site-packages\setuptools\_vendor\typeguard\_importhook.py", line 35, in <module>
    OPTIMIZATION = "typeguard" + "".join(version("typeguard").split(".")[:3])
AttributeError: 'NoneType' object has no attribute 'split'

Current pytest version

pytest               8.2.1

IF I install

pip install setuptools==71.0.0

I can run pytest successfully.

@RonnyPfannschmidt
Copy link
Member

This is a issue with setuptools, it's seemingly vendoring a package that's not vendoring safe

Its not clear if we can work around that

Cc @jaraco

@RonnyPfannschmidt
Copy link
Member

It seems there's already a bug fix release to setuptools from 3 hours ago, please check the latest patch release

@jaraco
Copy link
Contributor

jaraco commented Jul 18, 2024

Was reported in pypa/setuptools#4480 and fixed in v71.0.2. Closing, but do please report if for whatever reason it's not fixed for you.

@jaraco jaraco closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants