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

"Current Python" factor #14

Open
adamchainz opened this issue Oct 20, 2020 · 0 comments · May be fixed by #15
Open

"Current Python" factor #14

adamchainz opened this issue Oct 20, 2020 · 0 comments · May be fixed by #15

Comments

@adamchainz
Copy link

Using GitHub Actions, my projects use one CI run per Python version. Within these runs I'd want to run just the environments matching the current Python version.

I currently do this with a bit of shell:

ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox

In this discussion on django/daphne, I was introduced to tox-factor. It seems it would be possible to shorten my shell down to:

python -m tox -f py$(python --version 2>&1 | cut -c 8,10)

I'd like to suggest supporting this syntax to declare "all environments that match the current version of Python":

tox -f py

This would be analogous to tox -e py, which means "create a tox environment whose specifier is the current version of python". (This is only the current version, e.g. py38 even when it doesn't exist in defined environments and only as e.g. py38-djangoXX...).

adamchainz added a commit to adamchainz/tox-factor that referenced this issue Oct 20, 2020
@adamchainz adamchainz linked a pull request Oct 20, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant