• Stars
    star
    123
  • Rank 282,508 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pipenv plugin for Tox

tox-pipenv

PyPI - Downloads

A tox plugin to replace the default use of virtualenv with Pipenv.

This is a convenient way to retain your use of Pipenv, whilst testing multiple versions of Python.

Installation

pip install tox-pipenv

Or,

pipenv install tox-pipenv

Creating virtual environments

With this plugin, tox will use pipenv --python {python binary} as given to the tox interpreter for each python path.

If you already have virtual environments cached with tox, use the --recreate flag to recreate them with pipenv.

Note: tox will pass the --site-packages flag to pipenv if this is configured in your tox config.

The Pipfile will exist in .tox/{env}/Pipfile as well as Pipfile.lock

Installing requirements

The installation of requirements from your tox config will be passed to pipenv install for installation into the virtual environment. This replaces the use of pip within tox.

requirements.txt files will also be parsed by Pipenv and used for each test environment

Executing tests

Each of the commands in your testenv configuration will be passed to pipenv to execute within the pipenv virtual environment

Example tox.ini

This simple example will test against Python 2.7 and 3.6 using pytest to execute the tests.

[tox]
envlist = py27, py36

[testenv]
deps =
    pytest
    pytest-mock
commands = python -m pytest test/

Frequently asked questions

Where to install

Tox-Pipenv should be installed in the same environment as Tox, whether that is in a virtualenvironment, system environment or user environment. Tox-Pipenv depends on Tox 3.0 or newer.

Is user expected to create Pipfile and Pipfile.lock before executing tox with this plugin?

Yes, although if you are migrating from a requirements.txt to a Pipfile, you can use Pipenv to create the Pipfile for you.

Is Pipfile.lock expected to be under source control?

According to pipenv documentation, Pipfile.lock is not recommended under source control if it is going to be used under multiple Python versions.

What is the role of requirements.txt file?

Often, tox users use requirements.txt which is then referenced from within tox.ini file as deps. Pipenv will automatically install any packages listed in requirements.txt for each virtual environment that Tox creates.

Is tox.ini deps section really in control?

No, this is a known limitation.

Authors

  • Anthony Shaw
  • Omer Katz
  • Almog Cohen

More Repositories

1

tox

Command line driven CI frontend and development task automation tool.
Python
3,558
star
2

pipdeptree

A command line utility to display dependency tree of the installed Python packages
Python
2,710
star
3

filelock

A platform-independent file lock for Python.
Python
696
star
4

sphinx-autodoc-typehints

Type hints support for the Sphinx autodoc extension
Python
531
star
5

tox-travis

Seamless integration of tox into Travis CI
Python
203
star
6

tox-docker

A tox plugin to run one or more Docker containers during tests
Python
173
star
7

pyproject-fmt

Python
160
star
8

tox-conda

Make tox cooperate with conda envs
Python
152
star
9

tox-pyenv

plugin that tells tox to use `pyenv which` to find python executables
Python
127
star
10

detox

distributed tox (tox plugin to run testenvs in parallel)
Python
48
star
11

tox-ini-fmt

Formats your tox.ini files
Python
40
star
12

tox-gh

Github Action support for tox 4 and later
Python
39
star
13

azure-pipelines-template

template for your azure pipelines
24
star
14

tox-uv

Use https://github.com/astral-sh/uv with tox
Python
23
star
15

tox-venv

Use Python 3 venvs for Python 3 test environments
Python
21
star
16

pyproject-api

API to interact with the python pyproject.toml based projects
Python
21
star
17

sphinx-argparse-cli

Render CLI arguments (sub-commands friendly) defined by the argparse module.
Python
20
star
18

pyproject-fmt-rust

Rust
8
star
19

devpi-process

Python
7
star
20

gh-action-tox

Run tox as a Github Action
Dockerfile
6
star
21

tox-report

Records tox console output and produces a colored HTML report with it.
Python
6
star
22

tox-extra

Tox plugin which adds few extra checks like assuring that git does not report dirty
Python
5
star
23

cookiecutter-tox-plugin

Cookiecutter template for tox plugins
Python
5
star
24

tox-bindep

Tox plugin to run bindep checks before tests
Python
4
star
25

workflow

3
star
26

tox-external-wheels

A plugin for tox to allow external wheels for testing
Python
3
star
27

py-discovery

Python
1
star