Skip to main content

Adds the virtual environment's bin directory to PATH before executing a command

Project description

vrun

A small Python helper tool that will modify the PATH in the environment before executing the provided executable. This is useful when programs expect certain binaries to be available in PATH so they can execute them using os.popen() and friends or even for shell scripts that are executing Python tools that one would prefer to not globally install.

Scripts may detect that vrun has been used by looking for the environment variable VRUN_ACTIVATED which is set to 1 when run. It is not recommended that script writers do this.

Use

$ python3 -mvenv ./env/
$ ./env/bin/pip install vrun
$ ./env/bin/vrun /bin/bash -c 'echo $PATH'

If for example there is a script that executes pip without explicitly providing a PATH that includes a virtual environment the system installed pip may accidentally be invoked instead. With vrun the virtual environment will come first in the search path and thus pip will be safely executed within the context of the virtual environment.

$ ./env/bin/vrun ./myscript.sh

vrun or vexec

vrun installs itself as both vrun and vexec. The later may be typed with the left hand only and is slightly faster to roll off the keyboard!

License

Please see the LICENSE file in the source code repository

0.2 (2017-06-08)

  • Also export the environment variable VIRTUAL_ENV pointing to the virtual environment.

0.1 (2017-06-08)

  • Initial release and implementation of the vrun functionality

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

vrun-0.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vrun-0.2-py2.py3-none-any.whl (7.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file vrun-0.2.tar.gz.

File metadata

  • Download URL: vrun-0.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vrun-0.2.tar.gz
Algorithm Hash digest
SHA256 e5507236c33412406a5468a35a80dbd968076ad739b39cbb92bbd2e30cdd7bfa
MD5 ad3e6a6411999f5aef57d3e218faa53b
BLAKE2b-256 40b405571c4a2fc7acf6f14208555aad59fe0354040d414a5c72972ec2c8542a

See more details on using hashes here.

File details

Details for the file vrun-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: vrun-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vrun-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d8f48802e9ca2902a0cf1faf55519a62981342b8e944931b9265cc5e265de496
MD5 2753f3cd55a8be250255d7a0c64901ad
BLAKE2b-256 a9e4f2ec880b91d0087baa6c1a98654863744f043befdf3724d91d8ac6392c39

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