Porting tox legacy ini to toml with factors #3648
-
|
Hi, I have a project with tox configuration for testing, with different versions of Python and Django. With the move from tox 3 to tox 4, I included the configuration as a legacy ini in my My current file includes: [tool.tox]
legacy_tox_ini = """
[tox]
envlist = py39-django42, py{310,311,312}-django{42,50,51,52}, py313-django{51,52,main}
skipsdist = True
[testenv]
deps =
flake8
django42: Django>=4.2,<4.3
django50: Django>=5.0,<5.1
django51: Django>=5.1,<5.2
django52: Django>=5.2,<5.3
djangomain: git+https://github.com/django/django.git@main#egg=django
psycopg2-binary
dj-database-url>=2.3.0,<3.0
# ...
"""Is there a sensible way to reproduce this with native TOML? All I could find required giving up all the shorthands -- e.g. if an envlist like this can still be defined at all, it seems to require also that each of the combinations of Python and Django be explicitly given its own TOML table. Is there a way to do this without massive duplication? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
|
hi edit: had to roll back to tox.ini as even all in
I ended up with this (here with some additional TOML things just as example) [tool.tox]
requires = [
"tox>=4",
"tox-uv",
]
isolated_build = true
legacy_tox_ini = """
[tox]
envlist = {linux,windows}-{py313,py314}-{checkers}
"""it seems sensible and it seems to work well I was wondering if a TOML array of arrays could do? surely without the brace-patterns
|
Beta Was this translation helpful? Give feedback.
https://tox.wiki/en/stable/config.html