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

tox 4.0.15: ImportError: cannot import name 'DepConfig' from 'tox.config' #2759

Closed
wookayin opened this issue Dec 20, 2022 · 2 comments
Closed

Comments

@wookayin
Copy link

Issue

ImportError: cannot import name 'DepConfig' from 'tox.config' upon running tox

Environment

Provide at least:

  • OS: macOS
  • pip list of the host Python where tox is installed:
tox == 4.0.15

Output of running tox

Provide the output of tox -rvv:

Traceback (most recent call last):
  File "/Users/wookayin/.miniforge3/envs/py311/bin/tox", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/run.py", line 38, in main
    state = setup_state(args)
            ^^^^^^^^^^^^^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/run.py", line 53, in setup_state
    options = get_options(*args)
              ^^^^^^^^^^^^^^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/config/cli/parse.py", line 38, in get_options
    guess_verbosity, log_handler, source = _get_base(args)
                                           ^^^^^^^^^^^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/config/cli/parse.py", line 61, in _get_base
    MANAGER.load_plugins(source.path)
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/plugin/manager.py", line 90, in load_plugins
    self._register_plugins(inline)
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/plugin/manager.py", line 38, in _register_plugins
    self.manager.load_setuptools_entrypoints(NAME)
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/importlib/metadata/__init__.py", line 198, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/testmon/tox_testmon.py", line 6, in <module>
    from tox.config import DepConfig
ImportError: cannot import name 'DepConfig' from 'tox.config' (/Users/wookayin/.miniforge3/envs/py311/lib/python3.11/site-packages/tox/config/__init__.py)

Minimal example

If possible, provide a minimal reproducer for the issue:

# tox.ini
[tox]
env_list =
    py310
    py39
    py38
    py37
$ tox
@wookayin
Copy link
Author

wookayin commented Dec 20, 2022

Seems this happens with tox >= 4.0; it's OK with tox < 4.0. Was DepConfig deprecated or removed?

Seems this is a problem of pytest-testmon (installed: 1.4.2) that is not compatible with tox 4.x. Removing pytest-testmon resolves the issue temporarily.

@gaborbernat
Copy link
Member

Yes this is not a thing with tox 4.

@gaborbernat gaborbernat closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
jfrost-mo added a commit to MetOffice/CSET that referenced this issue Jul 5, 2023
Currently it was crashing due to tox-conda not supporting tox 4.
See tox-dev/tox#2759 for details.
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

2 participants