Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

tox-travis 0.12 is incompatible with tox 4.0.0 #159

Open
ni-jfitzger opened this issue Dec 7, 2022 · 3 comments
Open

tox-travis 0.12 is incompatible with tox 4.0.0 #159

ni-jfitzger opened this issue Dec 7, 2022 · 3 comments

Comments

@ni-jfitzger
Copy link

Details from ni/nimi-python#1875

When using travis-tox with tox 4.0 in the nimi-python project, the following traceback was produced:

Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.10.4/bin/tox", line 8, in <module>
    sys.exit(run())
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/run.py", line 38, in main
    state = setup_state(args)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/run.py", line 53, in setup_state
    options = get_options(*args)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/config/cli/parse.py", line 38, in get_options
    guess_verbosity, log_handler, source = _get_base(args)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/config/cli/parse.py", line 61, in _get_base
    MANAGER.load_plugins(source.path)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/plugin/manager.py", line 83, in load_plugins
    self._register_plugins(inline)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/plugin/manager.py", line 37, in _register_plugins
    self.manager.load_setuptools_entrypoints(NAME)
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/opt/python/3.10.4/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/opt/python/3.10.4/lib/python3.10/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 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 "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox_travis/hooks.py", line 6, in <module>
    from .envlist import (
  File "/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox_travis/envlist.py", line 10, in <module>
    from tox.config import _split_env as split_env
ImportError: cannot import name '_split_env' from 'tox.config' (/home/travis/virtualenv/python3.10.4/lib/python3.10/site-packages/tox/config/__init__.py)

According to the Tox FAQ Tox 4 has a new plugin system.
Excerpt:

tox 4 - new plugin system
tox 4 is a grounds up rewrite of the code base, and while we kept the configuration layer compatibility no such effort has been made for the programmatic API. Therefore, all plugins will need to redo their integration against the new code base. If you’re a plugin developer refer to the plugin documentation for more information.

@ryanhiebert
Copy link
Collaborator

ryanhiebert commented Dec 7, 2022

Thank you for the report. The next steps to resolve this issue as I see them are:

  1. Confirmation and failing test case(s). This may be as easy as just running the tests in an updated environment.
  2. For a quick patch, we can release a new version that requires tox<4. This won't be the ideal fix, but it should be a reliably quick way to implement it.
  3. Then we can figure out a proper patch to work with the newer version of tox. Hopefully we can do that without breaking compatibility with the previous versions.

@ryanhiebert
Copy link
Collaborator

I don't think I'll figure out a proper patch. I've closed a slew of old issues that haven't had motion in years. I don't use Travis. I have a pull request that encodes that tox must be <4, and because of how the CI is set up, I can't currently merge or deploy that. I set up automatic deployments way back when, but it doesn't even seem that the Travis jobs are running on the pull request, so I'm not convinced that there will be, or necessarily should be, near future action to remedy that.

apotterri added a commit to getappmap/appmap-python that referenced this issue Dec 9, 2022
Until tox-dev/tox-travis#159 is fixed, pin to
tox 3 so we can continue to use tox-travis.
garyvdm added a commit to garyvdm/aiohttp-swagger3 that referenced this issue Dec 15, 2022
@jefvantongerloo
Copy link

Issue confirmed.
Fixed by using 3.x version in job stage:

 install:
            - pip install tox-travis
            - pip install tox==3.28.0

i-trofimtschuk added a commit to djangsters/redis-tasks that referenced this issue Dec 20, 2022
i-trofimtschuk added a commit to djangsters/redis-tasks that referenced this issue Dec 20, 2022
also pin tox to <4 for tox-travis compatibility
see tox-dev/tox-travis#159
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants