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.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.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

vrun-0.1-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for vrun-0.1.tar.gz
Algorithm Hash digest
SHA256 76173eff62d8512740ed03f4b1d622fe7db54f035110b44dc267c7b06afe63d9
MD5 29de613231e7973f459d67d6027399e4
BLAKE2b-256 d0385452f47349ff1683a4c708dcc2575daa635ccb458e8ed0d100d48fa01561

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vrun-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2c3287befe354ac26bee490cc1b49d9348147a1a2793a74f8c12261e6f2c8730
MD5 27949100ce328b0b5e0e2399f59b55fc
BLAKE2b-256 160e1b407f98b9fc3e66a7551288e31eeaf54d866d5af31c25455a17af2c671b

See more details on using hashes here.

Supported by

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