https://app.codecov.io/gh/libranet/autoadd-bindir
Autoadd-bindir
Automatically add the bin-directory of your virtualenv to the PATH-environment variable
via sitecustomize-entrypoint. You now no longer need to manually activate your
virtual environment for the sole purpose of adding thie bin-drectory to your $PATH.
How does it work?
We register the autoadd_bin.entrypoint()-function to the sitecustomize-module that is installed by the
sitecustomize-entrypoints-package.
The registered 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 to do explicitly.
We can validate that the plugin work correctly by 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 our pyproject.toml_:
[tool.poetry.plugins]
[tool.poetry.plugins."sitecustomize"]
autoadd_bindir = "autoadd_bindir:entrypoint"
Sitecustomize and all its registered entrypoints will be executed at the start of every python-process. For more information, please see sitecustomize-entrypoints
Compatibility
autoadd-bindir works on Python 3.8+, including PyPy3. Tested until Python 3.11,
Notable dependencies
Metadata
Release files for autoadd-bindir 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autoadd_bindir-1.0.6.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoadd_bindir-1.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / autoadd_bindir-1.0.6.tar.gz
| Download URL | autoadd_bindir-1.0.6.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be3548033067ce64a4f5e76420f25d09a5659f2f6abf9c3c7d0bc297524da8ce
|
|
BLAKE2b-256 checksum How to use checksums |
3bcb4782b080c26098002ebbb0398d565d39252bde5cc933ad947dfdb5a6e4ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.2 Linux/5.15.90.1-microsoft-standard-WSL2
|
Release files / autoadd_bindir-1.0.6-py3-none-any.whl
| Download URL | autoadd_bindir-1.0.6-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b42dd718171bfb14dfc6738015418b918d0233dc7498852e2c4a9d373a00a9f3
|
|
BLAKE2b-256 checksum How to use checksums |
7f895f11b8edd8071fe226802b7eb18f898590d23a783b6e949a09bbccfbf488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.2 Linux/5.15.90.1-microsoft-standard-WSL2
|