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

Ability to include/extend other inis in tox.ini #364

Closed
pytoxbot opened this issue Sep 17, 2016 · 7 comments
Closed

Ability to include/extend other inis in tox.ini #364

pytoxbot opened this issue Sep 17, 2016 · 7 comments
Labels
area:configuration needs:discussion It's not quite clear if and how this should be done

Comments

@pytoxbot
Copy link

it would be useful to be able to share/reuse config (for example, a style toxenv) through some sort of include syntax in tox.ini.

e.g. in tox.ini:

[tox]
envlist = py27,py35,style
include = tox-style.ini

and style.ini:

[testenv:style]
....

That's almost definitely not the right syntax to use, but I think it gets the idea.

@RonnyPfannschmidt
Copy link

configuration inclusion and inheritance are both topics that are fundamentally hard to do well/right

as such we happily accept documentation showing how people would expect it to work
so that we or an outside volunteer can implement it based on those examples

(factors came in that way)

@obestwalter obestwalter added area:configuration needs:discussion It's not quite clear if and how this should be done and removed enhancement labels Sep 4, 2017
@delijati
Copy link

delijati commented Jun 1, 2018

zc.buildout is also based on ini files and has a nice include/inherit and overwrite capability

@gaborbernat
Copy link
Member

I think the direction now is to move to pyproject.toml as such I vote for closing this issue as won't fix. It's unlikely anyone will pick this up, and would prefer to see an option based on the pyproject.toml. @obestwalter @asottile opinions?

@RonnyPfannschmidt
Copy link

closing, tox plugins should provide what was proposed

@Aricg
Copy link

Aricg commented Sep 11, 2018

I think the direction now is to move to pyproject.toml as such I vote for closing this issue as won't fix. It's unlikely anyone will pick this up, and would prefer to see an option based on the pyproject.toml. @obestwalter @asottile opinions?

I'm not up to date here... How does a pyproject.toml eliminate the need for a .tox?

[tox]
minversion = 1.6
envlist =
    docs,
    docs-linkcheck
skipsdist = true

[testenv:docs]
deps = -rdocs/requirements.txt
commands =
    sphinx-build -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html

[testenv:docs-linkcheck]
deps = -rdocs/requirements.txt
commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck

@ngie-eign
Copy link

ngie-eign commented Jun 2, 2020

Much like @Aricg, I came to this issue looking for a better description of how to do this because my group is trying to avoid having to check in, install, and subsequently maintain hundreds of tox.ini files as part of the development in our project, or create Makefile or setup.py snippets that effectively template the tox.ini files.

@obestwalter, @asottile, @gaborbernat: can you please provide more details about how pyproject.toml can solve this deficiency?

flake8, for instance, has the ability to append a configuration on-demand, as noted here:

  --append-config=APPEND_CONFIG                                                                                                                                                                                                                                      Provide extra config files to parse in addition to the
                        files found by Flake8 by default. These files are the                                                                                                                                                                                        last ones read and so they take the highest precedence
                        when multiple files provide the same option.                                                                                                                                                                           --config=CONFIG       Path to the config file that will be the authoritative
                        config source. This will cause Flake8 to ignore all
                        other configuration files.

@asottile
Copy link
Contributor

asottile commented Jun 2, 2020

I believe the idea above is to write a tox plugin which provides the defaults that you need. Installing a plugin which sets the reasonable defaults for your organization would remove most-if-not-all of the boilerplate of a configuration

I believe the tox_configure hook provides access to the tox configuration where you could add / remove / modify testenvs

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:configuration needs:discussion It's not quite clear if and how this should be done
Projects
None yet
Development

No branches or pull requests

9 participants