Skip to main content

[![Build Status](https://travis-ci.com/pglass/tox-pip-version.svg?branch=master)](https://travis-ci.com/pglass/tox-pip-version) ![](https://img.shields.io/pypi/v/tox-pip-version.svg) ![](https://img.shields.io/pypi/pyversions/tox-pip-version.svg)

Overview

This is a tox plugin that preinstalls a specific version of pip in each tox environment.

`bash pip install tox-pip-version `

This works around the default behavior of tox/virtualenv that always installs the latest version pip. It is an improvment over the VIRTUALENV_NO_DOWNLOAD=1 option that does not install the latest version, but could result in usage of an outdated version of pip.

Recommendation: Do not pin the pip version long term. You get more stable repeatable builds, but at the cost of using an outdated (possibly vulnerable) package. This should be used as a temporary fix for breakages in upstream pip, or in conjunction with a regular process to update the version pin.

Note: This relies on an [unstable tox plugin interface]( https://tox.readthedocs.io/en/latest/plugins.html#tox.hookspecs.tox_testenv_create). You may experience breakage with new tox versions. If you do, please feel free to [report the issue](https://github.com/pglass/tox-pip-version/issues/new) on Github.

### Usage

Install the package and include pip_version in your tox.ini

`tox [testenv] pip_version = pip==19.0.1 `

Or, set the TOX_PIP_VERSION environment variable,

`bash export TOX_PIP_VERSION=18.1 tox `

The plugin will install that version of pip into the tox-created virtualenv, just after tox creates the virtualenv, but before dependencies are installed.

The pip_version within tox.ini, if present, is always used over the environment variable.

If neither pip_version or TOX_PIP_VERSION is present, the plugin does nothing.

### Version Sets

Version sets/ranges are supported, enabling installation of a version of pip matching a set of specifiers. There are two basic formats: a plain version number, or the package name with optional [PEP440-compatible]( https://www.python.org/dev/peps/pep-0440/#version-specifiers) version specifiers.

tox.ini | effective pip command |
—————————- | —————————- |
pip_version = 19.0 | pip install -U pip==19.0 |
pip_version = pip==19.0 | pip install -U pip==19.0 |
pip_version = pip>=19.0 | pip install -U pip>=19.0 |
pip_version = pip!=19,>18 | pip install -U pip!=19,>18 |
pip_version = pip | pip install -U pip |

### Tests

Use make test to run the tests, which includes linting and functional tests.

Each of the tests/* directories is a “feature” that needs testing. Each feature sub-directory contains a tox.ini file that sets pip version in a particular way, and then uses a tox command to check the correct pip version was installed.

Metadata

Release files for tox-pip-version 0.0.7

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-pip-version 0.0.7
File Size Uploaded Provenance
tox-pip-version-0.0.7.tar.gz 8.4 kB Without provenance Details

Release files / tox-pip-version-0.0.7.tar.gz

Download URL tox-pip-version-0.0.7.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fff6c54524f1826a13b39aaeba6cd6e38840e9a2efaf6e540e7caa5ff0e705eb
BLAKE2b-256 checksum
How to use checksums
3ca149c1c3ab6140e72a3ad0439c9dded0f1dae4e5e340f573a5f081b4989b30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.3

Security for tox-pip-version 0.0.7

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