Skip to main content

tox-min-req

PyPI - Version PyPI - Python Version Code style: black Development Status Tests PyPI - License codecov Downloads

Table of Contents

tox-min-req is a tox plugin that simplifies
minimum requirements (min-req) testing.

Minimum requirements testing is important to validate whether the minimum requirements are satisfied.

After installing, to use this plugin you need to use MIN_REQ environment variable either in the call (e.g. MIN_REQ=1 tox -e py38-linux-pyqt5) or in setenv section of your tox configuration.

Why use this instead of deps attribute of the tox env section?

One alternative solution is to use the deps section in tox configuration to install min-req dependecies.

However, packages from deps and the actual package to be tested are installed in two independent steps. This means that some of the min-req dependencies could be upgraded or downgraded when installing the actual package.

The PIP_CONSTRAINT and UV_CONSTRAINT variables are used to pin the dependencies; it will apply to the 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 allows one to provide the following environment configuration options:

  • min_req - set to 1 to enable the minimum requirements testing; can be used instead of setting the environment variable.
  • min_req_constraints - list of additional constraints that will be used to generate the constraints file. This is useful in following scenarios:
    • Some of dependencies of an old version are incompatible with dependencies in latest version (see Known issues, below).
    • Maintainers would like to also test some problematic dependencies an old version, but not the 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 the generated constraints file—it will not be parsed.

Known issues

Pinning only direct dependencies

Because this plugin only parses setup.cfg or pyproject.toml files, it is not possible to pin any indirect dependencies. To pin indirect dependencies, the min_req_constraints environment configuration option should be used.

Spaces in the constraints file path

pip uses spaces as file path separators in the PIP_CONSTRAINT variable. This plugin stores the generated constraints file in a .tox temporary directory. As a result, if the path to the temporary directory contains spaces, then pip will not be able to find the constraints file.

In such a scenatio, one needs to set the TOX_MIN_REQ_CONSTRAINTS environment variable to the path where constraints file can 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 constraints file.

$ tox --min-req-constraints-path=/tmp -e py37

Metadata

Release files for tox-min-req 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tox-min-req 0.1.0
File Size Uploaded Provenance
tox_min_req-0.1.0.tar.gz 18.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tox-min-req 0.1.0
File Interpreter ABI Platform
tox_min_req-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / tox_min_req-0.1.0.tar.gz

Download URL tox_min_req-0.1.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d6a9ec04b52b328f44aa87605b4916bcec6ef9d0269be9a7e28639109b3a96d4
BLAKE2b-256 checksum
How to use checksums
d9d185b9dab8121b7020e098ea30131a9c461150cb297d4ff4e90d053d8a1a3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tox_min_req-0.1.0-py3-none-any.whl

Download URL tox_min_req-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04662a9d3e792411882788b10f4c5cb349b32fbb63d9b1715e10ce652b554b40
BLAKE2b-256 checksum
How to use checksums
56a59619a9f150072882e735d11db45e312810b23bc341140be46d7c598efaf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for tox-min-req 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page