This PR adds a new command called tox-quickstart (inspired by sphinx-quickstart), which asks the user a few questions and then spits out a simple tox.ini file for them to get started with.
I see this as valuable for beginners and veterans alike, as when I start a new project, I often have to find some other recent project of mine and then cargo cult the tox.ini from that one. I will enjoy using tox-quickstart instead. :-)
Possible future enhancements:
Attempt to automatically determine dependencies (maybe by looking at what's installed in the current virtualenv or scanning the setup.py or requirements.txt or even more crazily, running the tests after installing a magic import hook that tracks dependencies!)
Possibly generate clauses that illustrates more complex scenarios like when some environments require special dependencies in addition to the base dependencies.
a good idea i think. Regarding automatic deps what about a testrunner question, e.g. "setup.py test", "nosetests", "pytest" and "trial" - which would add the appropriate deps and suggest a default command (maybe auto detecting test(s) or testing directories).
To add such a PR, there definitely need to be tests which of course are some work - they should test all these default variations.
I just added tests/test_quickstart.py, which does some basic tests of the new functionality.
I haven't played yet with your idea of having a testrunner question - would you like me to work on that in this PR or would you like to merge what we have thus far and then work on refining tox-quickstart perhaps in another PR?
In generall, i think there should just be a testrunner question. In the future i expect tox to have direct support for specifying a "testrunner" with generalized "junitxml", "coverage", etc. options that will map to appropriate options with py.test and nose (and be rejected with "setuptest" and "trial") and will of course include dependencies as appropriate.
Thanks for the code review! I went ahead and made the changes that you suggested, including adding a short blurb about tox-quickstart to doc/index.txt.
The one thing that bugs me a little is how many questions there are for each of the individual Python environments -- that part is a bit tedious to go through. I am toying around in my head with other ideas like:
just having the user specify the comma-separated list (although this is what one would do in a tox.ini so this kind of diminishes the value of tox-quickstart)
having the user type each env they want one at a time and then enter a blank to indicate that they're done.
letting the user pick from a few pre-canned choices of envlists -- e.g.: "python2only" == "py24, py25, py26, py27", "modernpythons" == "py27, py32, py33, pypy"
I'm not sure which one I like and even if I did know, community members might have very different opinions, so I wonder if we should just put it out there and see how the community responds to it and then it can be tweaked later...
Hey Holger, I think in a1c66429ad41, you accidentally overwrote tox.ini with one generated by tox-quickstart. I almost did this myself several times, but was lucky enough to notice and do hg revert tox.ini. :-)