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-factor does not work with tox 4 #18

Open
aabmass opened this issue Jan 6, 2023 · 3 comments · May be fixed by #19
Open

tox-factor does not work with tox 4 #18

aabmass opened this issue Jan 6, 2023 · 3 comments · May be fixed by #19

Comments

@aabmass
Copy link

aabmass commented Jan 6, 2023

Any tox command immediately fails after installing tox-factor alongside tox 4:

tox --version
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /tmp/tmp.ZZGIilhvQf
Traceback (most recent call last):
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox_factor/compat.py", line 2, in <module>
    from tox.config.parallel import ENV_VAR_KEY_PUBLIC as TOX_PARALLEL_ENV
ModuleNotFoundError: No module named 'tox.config.parallel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tmp.ZZGIilhvQf/venv/bin/tox", line 8, in <module>
    sys.exit(run())
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/run.py", line 38, in main
    state = setup_state(args)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/run.py", line 53, in setup_state
    options = get_options(*args)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/config/cli/parse.py", line 38, in get_options
    guess_verbosity, log_handler, source = _get_base(args)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/config/cli/parse.py", line 61, in _get_base
    MANAGER.load_plugins(source.path)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/plugin/manager.py", line 90, in load_plugins
    self._register_plugins(inline)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox/plugin/manager.py", line 38, in _register_plugins
    self.manager.load_setuptools_entrypoints(NAME)
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/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 "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox_factor/hooks.py", line 5, in <module>
    from .compat import TOX_PARALLEL_ENV
  File "/tmp/tmp.ZZGIilhvQf/venv/lib/python3.10/site-packages/tox_factor/compat.py", line 4, in <module>
    from tox.config.parallel import ENV_VAR_KEY as TOX_PARALLEL_ENV
ModuleNotFoundError: No module named 'tox.config.parallel'

tested in a fresh python 3.10 virtualenv, pip freeze output

cachetools==5.2.0
chardet==5.1.0
colorama==0.4.6
distlib==0.3.6
filelock==3.9.0
packaging==22.0
platformdirs==2.6.2
pluggy==1.0.0
pyproject_api==1.4.0
tomli==2.0.1
tox==4.2.5
tox-factor==0.1.2
virtualenv==20.17.
@kevinmasterson
Copy link

Tox 4.x includes the "-f" factor option by default. You can remove tox-factor from your dependencies/requirements and tox should continue to work as before.

DouglasHeriot added a commit to DouglasHeriot/opentelemetry-operations-python that referenced this issue Aug 3, 2023
This is no longer necessary with tox version 4

rpkilby/tox-factor#18
DouglasHeriot added a commit to DouglasHeriot/opentelemetry-operations-python that referenced this issue Aug 3, 2023
aabmass added a commit to GoogleCloudPlatform/opentelemetry-operations-python that referenced this issue Aug 3, 2023
aabmass added a commit to GoogleCloudPlatform/opentelemetry-operations-python that referenced this issue Aug 3, 2023
* Remove instruction to install `tox-factor`

This is no longer necessary with tox version 4

rpkilby/tox-factor#18

* Empty commit to trigger build

---------

Co-authored-by: Aaron Abbott <[email protected]>
@aabmass
Copy link
Author

aabmass commented Aug 8, 2023

Would be nice to add a note to the README of this project pointing this out. I can send a PR or we can just close this issue

@iurisilvio
Copy link

I added a note in PR #19.

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 a pull request may close this issue.

3 participants