Sorry, something went wrong.
There was a problem hiding this comment.
Thanks a million for all of your great work!
I remember having had tox.ini for a while, but don't recall why it was removed.
Furthermore, I follow the reasoning behind this PR and agree that at this point it's probably not worth mentioning it directly in the README. The simplest way to run tests, albeit only in the current interpreter, still seems to be to use venv. I also think it's valid to let CI test everything. But what happens if a test fails in a python version that one doesn't have locally? Then having tox would certainly help fixing it.
Maybe in follow-up PR the contribution guide could be adjusted to include tox related development workflows, along with hints about why one would use it. That way it's presented as more of an evolution rather than a requirement. Also, I haven't heard of an alternative so tox seems to have uniquely useful capabilities, whether one likes its output style or not.
Regarding tox on CI, I'd definitely prefer keeping CI as is. Using tox related workflows certainly has advantages when starting a project as it saves dealing with GHA oneself, but since we have that already, using tox-specific workflow seems to abstract and occlude. Or in other words, right now I'd feel more in control with GHA, it's the devil I know.
Sorry, something went wrong.
|
Also, I haven't heard of an alternative so tox seems to have uniquely useful capabilities, whether one likes its output style or not. There is also nox, which I have heard is even more powerful, but I haven't really used it. |
Sorry, something went wrong.
|
Right! Since tox is the most used one, I think it's probably the one to keep unless there are issues that nox would solve. |
Sorry, something went wrong.
|
I think nox could probably take the place of both make and tox. But even if so, I'm not sure if that's really enough reason to switch to it, for this project. |
Sorry, something went wrong.
|
To my mind, the less python is needed, the better, so I am happy to stay with the little Makefile used here 😅. |
Sorry, something went wrong.
This adds a tox.ini file so that tox can be run locally to test on 3.7, 3.8, 3.9, 3.10, 3.11, and 3.12, or whichever of them are available, and also run the lint, formatting, and style checks.
Because CI also tests building the documentation, and it is convenient to be able to use tox to check all the things CI checks (albeit on just one's local platform), I have added a tox environment for that too. But because it actually writes to the build directory, I have not listed it in env_list at the top, so it doesn't run automatically--it can still be run with tox -e html. That could be improved in the future, but I think reasonable ways of doing so would involve modifying doc/Makefile to make it more configurable, and that seems outside the proper scope of this PR.
This PR does not use tox on CI. It is possible to use tox to drive tests on CI, such as with the tox-gh-actions plugin, but this does not do that, because:
So while I suspect it may eventually be a good idea to use tox on CI, I don't think it should be done until it is clearly no worse than the current approach and other readily available approaches.
My intention is also not for tox to replace other ways of running tests when developing locally. During routine development, tox may be too slow or its output too complicated, for regularly checking the status of some or all tests. Furthermore, pre-commit seems to be working great for the lint checks--and the lint tox environment I configured uses it, to as to pick up any new or changed linting tools automatically. (Also, not everyone likes tox.)
For these reasons, I have not modified the readme to replace anything with tox-based instructions. However, the readme could be modified to also talk about tox. I am not sure if that should be done either, because the users most interested in using tox are those already familiar with it, and they will notice the tox.ini. Furthermore, I think it may be best to see how it works out (for example, should it really have the environment for testing that we can build docs by actually building them?) before adding it to the readme or other project documentation. However, if you'd like tox instructions, or a mention of it, etc., added the readme, I'd be pleased to add it (as well as to make other requested changes).
Some other considerations: