autoset-pwd 0.1

Creator: coderz1093

Last updated:

Add to Cart

Description:

autosetpwd 0.1

https://app.codecov.io/gh/libranet/autoset-pwd
autoset-pwd
Automatically add the $PWD-directory to the PWD_DIR-environment variable
via sitecustomize-entrypoint.
How does it work?
We register the autoset_pdw.entrypoint()-function to the sitecustomize-module that is installed by the
sitecustomize-entrypoints-package.
The registered function will look up os.getcwd() in your current working directory and
set it as PWD_DIR-environment variable.
Installation
Install via pip:
> bin/pip install autoset-pwd

Or add to your poetry-based project:
> poetry add autoset-pwd

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 PWD_DIR-environment-variable:
> bin/python

>>> import os
>>> print(os.getcwd())
"<path-to-your-current-dir>"




print(os.getenv("PwD_DIR"))
""



Registered sitecustomize-entrypoint
The autoset_pwd-function is registered as a sitecustomize-entrypoint in our pyproject.toml_:
[tool.poetry.plugins]
[tool.poetry.plugins."sitecustomize"]
autoset_pwd = "autoset_pwd: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


autoset-pwd works on Python 3.8+, including PyPy3. Tested until Python 3.11,
Notable dependencies

sitecustomize-entrypoints

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.