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

Compatibility with tox 4 #673

Closed
frenzymadness opened this issue Nov 30, 2022 · 2 comments · Fixed by #687
Closed

Compatibility with tox 4 #673

frenzymadness opened this issue Nov 30, 2022 · 2 comments · Fixed by #687
Labels

Comments

@frenzymadness
Copy link
Contributor

Current Behavior

Tox 4 is now in release candidate 1 and it might make sense to take a look at how to support it here in tox_to_nox. Right now, tests results are:

FAILED tests/test_tox_to_nox.py::test_trivial - AttributeError: module 'tox.c...
FAILED tests/test_tox_to_nox.py::test_skipinstall - AttributeError: module 't...
FAILED tests/test_tox_to_nox.py::test_usedevelop - AttributeError: module 'to...
FAILED tests/test_tox_to_nox.py::test_commands - AttributeError: module 'tox....
FAILED tests/test_tox_to_nox.py::test_deps - AttributeError: module 'tox.conf...
FAILED tests/test_tox_to_nox.py::test_env - AttributeError: module 'tox.confi...
FAILED tests/test_tox_to_nox.py::test_chdir - AttributeError: module 'tox.con...
FAILED tests/test_tox_to_nox.py::test_dash_in_envname - AttributeError: modul...
FAILED tests/test_tox_to_nox.py::test_non_identifier_in_envname - AttributeEr...
FAILED tests/test_tox_to_nox.py::test_descriptions_into_docstrings - Attribut...

All failures caused by

def main() -> None:
        parser = argparse.ArgumentParser(description="Converts toxfiles to noxfiles.")
        parser.add_argument("--output", default="noxfile.py")
    
        args = parser.parse_args()
    
>       config = tox.config.parseconfig([])
E       AttributeError: module 'tox.config' has no attribute 'parseconfig'

Expected Behavior

It would be nice to have nox compatible with tox 4 when they release a final version.

Steps To Reproduce

Run nox tests with tox==4.0.0rc1

Environment

- OS:
- Python:
- Nox:

Anything else?

No response

@FollowTheProcess
Copy link
Collaborator

This is definitely something we'd like to continue to support. I've just had a little poke around 4.0.0rc1 and can't see an equivalent way of Nox loading the tox config file, admittedly I only did a quick scan.

It's worth looking into how we'd do this before deciding how to proceed

FollowTheProcess added a commit that referenced this issue Dec 7, 2022
* Constrain to tox<4.0.0 until #673 is addressed

* Use recommended pypa/publish version syntax

* Ignore B905 warning

* Remove rogue mocking of py._path

* Forgot to install pre-commit hooks :)
@FollowTheProcess
Copy link
Collaborator

So it turns out there is no supported way of parsing the tox config in version 4 that we can use. See the discussion.

Looks like the best we can do is:

  • Detect which tox version is installed at runtime
  • If <4 then use the current parsing method
  • If >=4 then we'll have to do something else, e.g. parse the CLI output as suggested in the discussion above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants