Adds the --py flag to tox to run environments matching a given Python interpreter.
Project description
Unmaintained (2022-12-08)
With the release of tox 4, this package is no longer necessary, and so is not being maintained. You can instead use tox 4’s -f option - see below.
Adds the --py flag to tox to run environments matching a given Python interpreter.
Installation
Use pip:
python -m pip install tox-py
Python 3.7 to 3.11 supported.
Only tox 3 is supported.
On tox 4, you can use the new -f factor option to select environments by Python version:
$ tox -f py310
On GitHub Actions, you can use -f with your matrix python version like so:
jobs:
tests:
name: Python ${{ matrix.python-version }}
strategy:
matrix:
python-version:
- 3.7
- 3.8
- 3.9
- '3.10'
- '3.11'
steps:
- ...
- name: Run tox targets for ${{ matrix.python-version }}
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
Testing a Django project? Check out my book Speed Up Your Django Tests which covers loads of ways to write faster, more accurate tests.
Usage
After installation, the plugin will be automatically picked up by tox. It adds one argument: --py, which takes the version to filter environments against. The version can be specified either as a tox.ini-style dotless version number, or the special string current for the version of Python that tox is running under.
For example, to run all Python 3.9 environments:
tox --py 39
Or to run all environments matching the version of Python that tox is running under:
tox --py current
This makes configuring CI really easy: configure your CI to trigger each Python version in parallel, running tox --py current.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tox-py-1.3.1.tar.gz
.
File metadata
- Download URL: tox-py-1.3.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 749ceb27062db13268881ec2f9bb0d8673839ea75feb0957f74756025737e256 |
|
MD5 | af3e52f1726771d8948460f32a0abb41 |
|
BLAKE2b-256 | 0db5a6a46d87686e2b6d306aafde6424348ce789b0bd3c2ae28aa24dfc13749f |
File details
Details for the file tox_py-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: tox_py-1.3.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51393c6df0b0d16c4d0acdfba947820a028c673f7b9e3ff1fd06146827884daf |
|
MD5 | 207b4f02decfc2a05fcdce21b4416c08 |
|
BLAKE2b-256 | 7be7f9cb516fc144aa2129f0fb24a4c4d8ee4590873942b6ba5c6ce79742ec5b |