Skip to content

Tests failing when building locally (in typeguard) #680

Closed
@jaraco

Description

@jaraco

When testing locally, I'm seeing this error:

 cheroot main @ tox
py: install_deps> .tox/py/bin/python -bb -E -s /Users/jaraco/code/cherrypy/cheroot/bin/pip-wrapper py /Users/jaraco/code/cherrypy/cheroot/requirements/ install -r requirements/tests.in
.pkg: install_requires> python -I -m pip install 'setuptools-scm>=7.0.0' 'setuptools>=34.4'
.pkg: _optional_hooks> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.12/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
.pkg: get_requires_for_build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.12/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
.pkg: install_requires_for_build_editable> python -I -m pip install 'setuptools_scm>=7.0.0' wheel
.pkg: build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.12/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
py: install_package_deps> .tox/py/bin/python -bb -E -s /Users/jaraco/code/cherrypy/cheroot/bin/pip-wrapper py /Users/jaraco/code/cherrypy/cheroot/requirements/ install 'importlib-metadata; python_version < "3.8"' jaraco.functools 'more-itertools>=2.6'
py: install_package> .tox/py/bin/python -bb -E -s /Users/jaraco/code/cherrypy/cheroot/bin/pip-wrapper py /Users/jaraco/code/cherrypy/cheroot/requirements/ install --force-reinstall --no-deps /Users/jaraco/code/cherrypy/cheroot/.tox/.tmp/package/1/cheroot-11.0.0b1.dev27+g9d4de6b0-0.editable-py3-none-any.whl
py: commands_pre[0]> .tox/py/bin/python -bb -E -s -m OpenSSL.debug
pyOpenSSL: 24.1.0
cryptography: 42.0.5
cffi: 1.16.0
cryptography's compiled against OpenSSL: OpenSSL 3.2.1 30 Jan 2024
cryptography's linked OpenSSL: OpenSSL 3.2.1 30 Jan 2024
Python's OpenSSL: OpenSSL 3.2.1 30 Jan 2024
Python executable: /Users/jaraco/code/cherrypy/cheroot/.tox/py/bin/python
Python version: 3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Platform: darwin
sys.path: ['/Users/jaraco/code/cherrypy/cheroot', '/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python312.zip', '/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12', '/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload', '/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages']
py: commands[0]> .tox/py/bin/python -bb -E -s -m pytest --color=yes
/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py:318: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ImportError: cannot import name 'Config' from 'pytest' (/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pytest/__init__.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
           ^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 143, in main
    config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pluggy/_callers.py", line 155, in _multicall
    teardown[0].send(outcome)
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pluggy/_result.py", line 99, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1283, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1172, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pluggy/_manager.py", line 414, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
    exec(co, module.__dict__)
  File "/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/typeguard/_pytest_plugin.py", line 7, in <module>
    from pytest import Config, Parser
ImportError: cannot import name 'Config' from 'pytest' (/Users/jaraco/code/cherrypy/cheroot/.tox/py/lib/python3.12/site-packages/pytest/__init__.py)
py: exit 1 (0.21 seconds) /Users/jaraco/code/cherrypy/cheroot> .tox/py/bin/python -bb -E -s -m pytest --color=yes pid=34147
  py: FAIL code 1 (8.42=setup[7.88]+cmd[0.33,0.21] seconds)
  evaluation failed :( (8.47 seconds)

I'm not sure why I'm not seeing the error in CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokentriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions