Skip to main content

plugin for tox - run everything directly (tox creates no virtual env)

Project description

tox-direct

PLEASE NOTE: only use this plugin if you know what you are doing and you have a good reason to do so. In the general case it is not necessary and considered bad practice.

tox plugin to be able to run commands directly without creating a virtual environments first.

This might seem pointless but if tox is used as a single entry point into all developer workflows this can be useful in certain scenarios - e.g.:

  • something needs to be done which does not require a virtual environment (because only system commands are run)
  • something has to run in the same interpreter that is running tox (e.g. testing things inside a docker container where everything is already set up correctly in a dedicated virtual environment)

At the moment there are two ways to run tox envs in direct mode:

  1. if the testenv name contains the word "direct"
  2. if the environment variable TOX_DIRECT is set

installation

pip install tox-direct

minimal example

[tox]
skipdist = True
; you could add this to express that it's needed but if it is not installed
; tox will create a venv and install it there and run everything from that
; venv which somehow defeats the purpose a bit then :)
;requires = tox-direct

[testenv:direct-action]
skip_install = True
commands = which python

[testenv:something-else]
skip_install = True
commands = which python

If I run these in a virtual environment (.virtualenvs/tmp) with tox and tox-direct installed:

$ tox -qre direct-action  

We need direct action! No virtual environment! Ain't Nobody Got Time for That!
/home/ob/.virtualenvs/tmp/bin/python
_______________________________ summary _______________________________________
  direct-action: commands succeeded
  congratulations :)
$ TOX_DIRECT=1 tox -qre something-else

We need direct action! No virtual environment! Ain't Nobody Got Time for That!
/home/ob/.virtualenvs/tmp/bin/python
_______________________________ summary _______________________________________
  something-else: commands succeeded
  congratulations :)

So everything would be executed (and also installed) directly in that environment.

Project details


Download files

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

Source Distribution

tox-direct-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file tox-direct-0.1.3.tar.gz.

File metadata

  • Download URL: tox-direct-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for tox-direct-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cb4d07d6b62531816a676999ccf95e54a8383caa4fd0e46c876567d2ddf5822a
MD5 1d3da130b1fcc4c7b0dd288035a221cf
BLAKE2b-256 3f024c75e306c5c8965af1875b49237ad0ea30a545a857261cfb86e7b008c1fe

See more details on using hashes here.

Supported by

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