Created
May 8, 2023 08:28
-
-
Save withakay/0d22dc2fd952c8d28085aba7f49882e9 to your computer and use it in GitHub Desktop.
Direnv .envrc defaults for python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### My current .envrc defaults for defaults for a python project | |
# I use asdf to manage runtimes. | |
# Using asdf with direnv like this removes the | |
# annoying shims, which for me is more reliable | |
# less confusing and slightly faster | |
use asdf | |
unset PYTHONHOME | |
# auto activate virtual environemnt | |
export VIRTUAL_ENV=$PWD/.venv | |
PATH_add $VIRTUAL_ENV/bin | |
source activate | |
# modify to suit current project | |
export PROJECT_ROOT_PATH="${PWD}" | |
export PYTHONPATH=$PROJECT_ROOT_PATH | |
# Optionally if you have a .env file and | |
# if you don't want to use dotenv from python | |
dotenv .env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment