Skip to content

Conversation

@ni-jfitzger
Copy link
Collaborator

@ni-jfitzger ni-jfitzger commented Dec 7, 2022

  • This contribution adheres to CONTRIBUTING.md.

  • [ ] I've updated CHANGELOG.md if applicable.

  • [ ] I've added tests applicable for this pull request

What does this Pull Request accomplish?

Tox 4.0.0 recently released and broke travis-ci builds, which now fail with

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.

Based on this, it can be assumed that tox-travis 0.12 won't work with tox 4. In order to fix travis-ci builds, we will specify "tox==3.*" to continue installing tox 3, as before.

List issues fixed by this Pull Request below, if any.

What testing has been done?

@ni-jfitzger ni-jfitzger changed the title Do not use tox 4.0.0 or later in travis-ci builds Use tox 3 in travis-ci builds Dec 7, 2022
@marcoskirsch marcoskirsch merged commit 189fa5e into ni:master Dec 8, 2022
@ni-jfitzger ni-jfitzger deleted the use-tox-3 branch December 8, 2022 22:34
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

Successfully merging this pull request may close these issues.

2 participants