Skip to main content

Use python3 venvs for python3 tox testenvs

Project description

https://travis-ci.org/tox-dev/tox-venv.svg?branch=master https://ci.appveyor.com/api/projects/status/fak35ur9yibmn0ly?svg=true https://codecov.io/gh/tox-dev/tox-venv/branch/master/graph/badge.svg https://img.shields.io/pypi/v/tox-venv.svg https://img.shields.io/pypi/l/tox-venv.svg

What is tox-venv?

tox-venv is a plugin that uses Python 3’s builtin venv module for creating test environments, instead of creating them with the virtualenv package. For Python versions that do not include venv (namely 3.2 and earlier), this package does nothing and reverts to tox’s default implementation.

Why use tox-venv?

virtualenv is historically Python 2/3 compatible, however to achieve this, it ships some files that are pinned at their Python 2.6 version, such as the site module (see: pypa/virtualenv#355). This has a few effects:

  • Builds using the -Werror option fail, as the deprecations are raised before the test suite can run.

  • Users cannot take advantage of newer features of the site module in their test environments.

  • Eventually, these deprecations will become exceptions in future versions of Python.

By using the builtin venv module, these issues can be avoided.

Installation & Usage

To use tox-venv, install it alongside tox in your environment. Then, run tox as normal - no configuration necessary.

$ pip install tox tox-venv
$ tox

If you have already ran tox, it’s necessary to recreate the test envs. Either run tox --recreate, or delete the .tox directory.

Compatibility

tox-venv is compatible with both Python 2 and 3, however it only creates test environments in Python 3.3 and later. Python 3.3 environments are only partially compatible, as not all options (such as --copies/--symlinks) were supported. Environments for Python 3.4 and later are fully compatible.

Release process

  • Update changelog

  • Update package version in setup.py

  • Create git tag for version

  • Upload release to PyPI

$ pip install -U setuptools wheel
$ rm -rf dist/ build/
$ python setup.py bdist_wheel upload

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

tox_venv-0.3.1-py2.py3-none-any.whl (4.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tox_venv-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tox_venv-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d92f03401bfb552b9f3b43f7693c22e6d7de2cb08e9cd087fd3b475ffa67defb
MD5 d8a9e0089ff4dfc32647ec037203a3a8
BLAKE2b-256 bdbdf981a5bcd5b90b65fbfd3e6d6d93d592721e2e946eaa08e9ea5d325a4077

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page