Code Monkey home page Code Monkey logo

tox-pipenv's Introduction

tox-pipenv

image

image

image

Updates

Python 3

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 documenation, 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

tox-pipenv's People

Contributors

tonybaloney avatar thedrow avatar pyup-bot avatar asottile avatar

Watchers

Stefano Apostolico avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.