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

Introduce an additional configuration file format? #600

Closed
obestwalter opened this issue Sep 4, 2017 · 21 comments
Closed

Introduce an additional configuration file format? #600

obestwalter opened this issue Sep 4, 2017 · 21 comments
Labels
area:configuration feature:new something does not exist yet, but should needs:discussion It's not quite clear if and how this should be done

Comments

@obestwalter
Copy link
Member

I want to open the discussion for adding a second possibility of configuring tox additionally to the tox.ini format. If we would do this, we could freeze the state of what tox.ini can and can't to to the state of what it is now and support it in that maintenance mode for a long time / infinitely.

This might be a very bad idea and could very possibly be just a knee jerk reaction to my not so pleasant experiences trying to fix #595 but I wanted to at least hear what others feel about this.

@obestwalter obestwalter added area:configuration feature:new something does not exist yet, but should needs:discussion It's not quite clear if and how this should be done labels Sep 4, 2017
@gaborbernat
Copy link
Member

I would prefer sticking to the current version, especially as many tools already integrate with the current configuration file.

@obestwalter
Copy link
Member Author

obestwalter commented Sep 4, 2017

The old format would likely be supported for a very long time, but I am a bit weary adding new features to the old config format. It is really quite convoluted already. At the very least the whole config related code would need a complete overhaul to keep it maintainable.

Also: what do you mean by integrating? They do things with the actual tox.ini?

@gaborbernat
Copy link
Member

I mean e.g. pytest accepts configuration data also from tox.ini. Which means they actually parse it; and there are other projects out there who do similarly. I'm aware it's really convoluted, as I already had luck dealing with it; but would still prefer/do the complete refactor than creating a new configuration file.

@RonnyPfannschmidt
Copy link

RonnyPfannschmidt commented Sep 4, 2017

@obestwalter a good number of tools like flake8 for example hijacked tox.ini, even pytest did, but for pytest we created a way that can work

in general both tox and pytest should take a look at pyproject.toml ^^

@obestwalter
Copy link
Member Author

obestwalter commented Sep 4, 2017

I mean e.g. pytest accepts configuration data also from tox.ini.

I see what you mean, this would still continue to work though. And if people would want to switch to the new format we either might be able to make it work just like that (if it would be TOML like @vlaci and @RonnyPfannschmidt suggested) that would be trivial. The guest project could just add another config file as source or they just have to move their configuration to setup.cfg or the orginal config file.

Anyway this is just dreaming a bit, because before this would be possible the related code needs to be refactored to prepare for that anyway and the refactoring might even already ease some of the maintenance pains.

@RonnyPfannschmidt
Copy link

personally i think starting to explore toml may open up a way to remove a lot of my pain points with the project

@gaborbernat
Copy link
Member

agreed, let's see then what we can do with TOML

@obestwalter
Copy link
Member Author

How about Python? Just learned about nox: http://nox.readthedocs.io/en/latest/ - started recently by @jonparrott.

@theacodes
Copy link

I recently did a quick talk about Nox at PuPPy - slides are here for those interested.

Fwiw - I think that there's room for both. I always considered Nox as an advanced tool and still use tox for several of my own projects. I think there's strength in both approaches - I don't think that tox needs to become Nox (or vice versa) any more than I think Flask needs to become Django.

@theacodes
Copy link

That said literally anything but ini files. :)

@merwok
Copy link

merwok commented Feb 26, 2018

One can also imagine tox devs publishing a small module to support parsing tox.ini or tox.toml into a structured form, and pytest / flake8 / coverage and others could rely on that lib for parsing.

@obestwalter
Copy link
Member Author

One can also imagine tox devs publishing a small module to support parsing tox.ini or tox.toml into a structured form

That sounds interesting, but I don't think it would solve the problem this issue is trying to address. For me the main problem is the parsing. It grew more and more complex when functionality was added and I think it was never really refactored to make it simpler. So another approach would be to invest some time to refactor the parsing code.

@pradyunsg
Copy link

Being able to use the tool.tox namespace within pyproject.toml for tox configuration would be neat. :)

@obestwalter
Copy link
Member Author

obestwalter commented May 13, 2018

Hi @pradyunsg - do you mean to have a "traditional" tox.ini being part of a pyproject.toml?

@pradyunsg
Copy link

Yep.

@obestwalter
Copy link
Member Author

Sounds like a good idea. Would you like to open an issue for that?

@obestwalter
Copy link
Member Author

So it looks like it definitely should be TOML.

@pradyunsg
Copy link

Would you like to open an issue for that?

#814

So it looks like it definitely should be TOML.

Indeed. I guess that means this issue can be closed.

@RonnyPfannschmidt
Copy link

simply inlining tox.ini in a pyproject.tmp feels a bit bad

@obestwalter
Copy link
Member Author

I know, this is why it should be toml, because then we either don't have to do it at all, if toml support comes first or only have to do it until toml support is implemented.

@obestwalter
Copy link
Member Author

Closing this as it looks like the decision has been made and now it is only a question of how to implement it, while retaining backwards compatibility. Issue for that is here: #814

@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 feature:new something does not exist yet, but should needs:discussion It's not quite clear if and how this should be done
Projects
None yet
Development

No branches or pull requests

6 participants