-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use tox so we can test multiple python versions locally #128
Comments
The advantage of using GHA to do this is we get multiple concurrent jobs. I don't think that would be the case with tox. |
@nh13 tox works well for this and will run multiple GHA jobs as expected: Here's an example from a personal OSS project: And the associated [tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py312,py311,py310,py39,py38
[gh-actions]
python =
3.12: py312
3.11: py311
3.10: py310
3.9: py39
3.8: py38
[testenv]
allowlist_externals = poetry
commands =
poetry install -v
poetry run pytest toolkit/ tests/
""" Tox has a feature request to update their config syntax to proper TOML (instead of ini-style) but at least it's all in the |
What I do locally is use pyenv, a very simple Python version management tool, to install all versions of Python on my local. I think of this as the environment layer between the system Python (which you should not touch) and deeper environments like venvs and conda environments. Of course, depending on your personal preferences, you can get multiple Python versions installed in other ways. Once I have those Pythons, then I have the option of running |
GHA does this, but it'd be more convenient if tests and checks could be run without pushing and the overhead of GHA
The text was updated successfully, but these errors were encountered: