- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 542
 
True TOML config support #3353
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
True TOML config support #3353
Conversation
9819aeb    to
    f2a6f74      
    Compare
  
    9a8a916    to
    7cc25cf      
    Compare
  
    Signed-off-by: Bernát Gábor <[email protected]>
Signed-off-by: Bernát Gábor <[email protected]>
9b75bf8    to
    e3bf846      
    Compare
  
    57c4e5c    to
    43d8113      
    Compare
  
    Signed-off-by: Bernát Gábor <[email protected]>
Following tox-dev/tox#3353 there is now full native TOML support for `tox`
Following tox-dev/tox#3353 but pending ymyzk/tox-gh-actions#197
| install tox into an isolated environment. This has the added benefit that later you'll be able to upgrade tox without | ||
| affecting other parts of the system. | ||
| :pypi:`tox` is a CLI tool that needs a Python interpreter (version 3.7 or higher) to run. We recommend either | ||
| :pypi:`pipx` or :pypi:`ruff` to install tox into an isolated environment. This has the added benefit that later you'll | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a typo? should it be uv and not ruff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes!
| 
               | 
          ||
| .. code-block:: bash | ||
| tox --override env_run_base.deps+=pytest-xdist | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it odd that overrides depend on the config file format. I'd expect the options to behave the same way regardless of the config file format.
At least it should be noted that default of base option is format-dependent above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Achieving this goal would require that the syntax for the new file format to be very ugly. testenv:whatever Is very much something we inherited in the INI world. Furthermore, this is already the case when using setup.CFG over tox.ini.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you read the configuration file format introduction section, it clearly calls out the differences.
| Historically, the INI format was created first, and TOML was added in 2024. The TOML format generally is more robust, | ||
| however is less powerful and more verbose. You should use TOML unless you need some of the more advanced features | ||
| that TOML does not support (such as conditional factors, generative environments to name a few -- however, PRs to | ||
| add support for these in TOML is welcome). | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd mark TOML config as experimental until all these are supported. Supporting those may affect the TOML file structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. Some of these features I explicitly do not want to support in the new format (such as conditional factors). The TOML file Format is just not a good match for it.
| ``tox.toml`` | ||
| ~~~~~~~~~~~~ | ||
| 
               | 
          ||
| This configuration file is equivalent to :ref:`pyproject.toml - native <pyproject-toml-native>` with the difference | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I very appreciate the option to have a separate TOML file 👍
Done:
pyproject.tomlsourcetox.tomlsourcehttps://tox--3353.org.readthedocs.build/en/3353/config.html#tox-toml
Resolves #999.