Tox plugin to run tests with minimal requirements base on setup.cfg or pyproject.toml
Project description
tox-min-req
Table of Contents
tox-min-req is a tox plugin that simplify the minimum requirements testing.
The minimum requirements is to validate if minimum requirements are satisfied.
To use this plugin you need to use MIN_REQ
environment variable either in call or in setenv
section
of tox configuration.
Why use this inseted of deps
attribute of env section?
One of the possible solution is to use deps
section in tox configuration to install dependecies in older version.
But deps
and package are installed in two independent steps. So it means that
some of dependencies could be upgraded or downgraded when installing package.
The PIP_CONSTRAINT
variable is used to pin the dependencies. And it will apply to call of pip install
during dependency resolving.
Installation
pip install tox-min-req
License
tox-min-req
is distributed under the terms of the MIT license.
Usage
The basic usage is to set the MIN_REQ
environment variable to 1
$ MIN_REQ=1 tox -e py37
Configuration options
The tox-min-req
plugin allow to provide following environment configuration options:
min_req
- set to1
to enable the minimum requirements testing, could be used instead of environment variable.min_req_constraints
- list of additional constrains that will be used to generate the constrains file. It could be useful in following scenarios:- Some of dependencies in old version is incompatible with its dependencies in latest version. (see Known issues)
- Maintainers would like to test also some problematic dependencies in old version, but not oldest supported version.
[tox]
envlist = py310
[testenv]
extras = test
recreate = True
commands = pytest test_file.py
min_req = 1
min_req_constraints=
coverage==6.5.0
babel==2.6.0
six==1.14.0
-r {project_dir}/constraints.txt
Please note that -r {project_dir}/constraints.txt
will be put in generated constrains file, not parsed.
Known issues
Pinning only direct dependencies
As this plugin parse only setup.cfg
or pyproject.toml
file, it is not possible to pin the indirect dependencies.
To provide the indirect dependencies pinning, the min_req_constraints
environment configuration option could be used.
Space in constrains file path
pip
is using the space as file path separator in PIP_CONSTRAINT
variable.
The plugin is storing the generated constrains file in the .tox
temporary directory.
If the path to the temporary directory contains space, the pip
will not be able to find the constrains file.
In such situation there is a need to set the TOX_MIN_REQ_CONSTRAINTS
environment variable
to the path where constrains file could be written.
$ TOX_MIN_REQ_CONSTRAINTS=/tmp MIN_REQ=1 tox -e py37
It is also possible to use the --min-req-constraints-path
command line option to set the path to the constrains file.
$ tox --min-req-constraints-path=/tmp -e py37
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
Hashes for tox_min_req-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bd9c97e3228148529e05e5e71465d0988023d5eae5c9ba8ebf5642a402c5703 |
|
MD5 | 403d7740facf1d792ddcb2f9386c660d |
|
BLAKE2b-256 | 8c436477606521be5a10f0c83014b3bd2916708ffe96d8e03fd7aeb23e2ba70d |