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

RFE: Prefer TOML-native configuration over legaci INI #3402

Open
hroncok opened this issue Oct 10, 2024 · 2 comments
Open

RFE: Prefer TOML-native configuration over legaci INI #3402

hroncok opened this issue Oct 10, 2024 · 2 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented Oct 10, 2024

What's the problem this feature will solve?

  • I want old tox versions to know I need tox >= 4.21
  • I want to use TOML-native configuration

If I have this:

[tool.tox]
requires = ["tox>=4.21"]
env_list = ["3.13", "3.12", "type", "doc"]
...

The old tox does not read it and ignores it.

If I change it like this:

[tool.tox]
legacy_tox_ini = """
    [tox]
    min_version = 4.21
"""
env_list = ["3.13", "3.12", "type", "doc"]
...

The old tox reads it and updates tox in the provision venv.
However, the TOML-native configuration is ignored by the new tox.

Describe the solution you'd like

I believe this could be solved if the new tox preferred the TOML-native configuration over legacy_tox_ini if both exist.

Alternative Solutions

I could stick with legacy_tox_ini unless I know all environments are fully updated to tox > 4.21.

Thanks

@gaborbernat
Copy link
Member

gaborbernat commented Oct 10, 2024

PR welcome 👍 likely just need to swap it here. https://github.com/tox-dev/tox/blob/2bf065a/src/tox/config/source/discover.py#L22 and add test to confirm it 👍 plus updating the docs.

@hroncok hroncok changed the title RFE: Prefer TOX-notive configuration over legaci INI RFE: Prefer TOML-native configuration over legaci INI Oct 11, 2024
@hroncok
Copy link
Contributor Author

hroncok commented Oct 14, 2024

I think this is useful, so I'll try to dedicate some time to work on this this week, but no promises.

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

No branches or pull requests

2 participants