check-python-versions icon indicating copy to clipboard operation
check-python-versions copied to clipboard

support for tox into setup.cfg

Open gpongelli opened this issue 2 years ago • 5 comments

Tox can be configured also into setup.cfg file, e.g.

[tox:tox]
isolated_build = true
envlist = lint, format, py3.8, py3.9, py3.10, py3.11, build

or, using default naming convention

[tox:tox]
isolated_build = true
envlist = lint, format, py38, py39, py310, py311, build

gpongelli avatar Jan 26 '23 11:01 gpongelli

Wait. tox allows dots in environment names? tox -e py3.11? Whoa. That should probably be a separate issue.

mgedmin avatar Jan 27 '23 07:01 mgedmin

This is a surprise for me, too. I will check with the other maintainers whether this was introduced intentionally with tox v4 or not.

jugmac00 avatar Jan 27 '23 07:01 jugmac00

Ok, looks like this is a feature, and not even a new one, see https://tox.wiki/en/latest/user_guide.html#test-environments

jugmac00 avatar Jan 27 '23 07:01 jugmac00

Wait. tox allows dots in environment names? tox -e py3.11? Whoa. That should probably be a separate issue.

I don't know. I use this dotted notation because, having poetry that run tox environments locally and remotely, I've encountered errors when using normal notation (py39 , py310...) . This is because I need to use poetry environments (where packages from poetry.lock are installed, also tox) instead of directly running tox environments (if so, there is a duplication of package lists to be installed: first list into pyproject.toml for poetry env and then same list into setup.cfg/tox.ini for tox); I obviously prefer having only one source of truth instead of maintaining same things in different places. If you want elaborate on, this is the cookiecutter template I've created and constantly use to create new packages using both poetry and tox.

Reading the link from @jugmac00 , seems it's "supported" : You can also specify these factors with a period between the major and minor versions (e.g. pyN.M) , but I use them just for poetry environment switching.

gpongelli avatar Jan 27 '23 08:01 gpongelli

I've done changes on local branch for this issue, but it depends on PR #39 so I wait to push it until dependent PR will be merged 😉

gpongelli avatar Jan 30 '23 10:01 gpongelli