Automatically add bin-dir to PATH for every process in your virtualenv.
Project description
Autoadd-bindir
Automatically add the bin-directory of your virtualenv to the PATH
-environment variable.
You no longer need to manually activate your virtual environment.
How does it work?
We register the autoadd_bin.entrypoint()
-function to sitecustomize-module that run for every python
The function will look up sys.prefix
of your python-executable and add the corresponding bin-directory
to the PATH
.
Installation
Install via pip:
> bin/pip install autoadd_bindir
Or add to your poetry-based project:
> poetry add autoadd_bindir
Validate & Usage
After installing this package there is nothing left you need to do explicitly.
We can validate the plugin works correctly b starting a python-session and checking the PATH
-environment-variable?
> bin/python
>>> import os
>>> print(os.getenv("PATH"))
"<path-to-your-virtualenv>/bin", ...
Registered sitecustomize-entrypoint
The autoadd_bindir
-function is registered as a sitecustomize
-entrypoint in pyproject.toml_:
[tool.poetry.plugins]
[tool.poetry.plugins."sitecustomize"]
autoadd_bindir = "autoadd_bindir:entrypoint"
Sitecustomize and all its entrypoints will be executed at the start of every python-process.
For more information, please see sitecustomize-entrypoints
Dependencies
- sitecustomize-entrypoints
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
Built Distribution
Hashes for autoadd_bindir-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd83ade152efe1696cc0899ae468392f3da673f7a21aad165e3ca355ad1f20d8 |
|
MD5 | 9657228dfb2fc63848b72b04a53e1387 |
|
BLAKE2b-256 | 08268e91a991246b80e7e0bdd930fc419dcb92a7ac5fa27ad03cabb591042c78 |