forked from behave/behave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc.use_pep0582.disabled
29 lines (26 loc) · 1.29 KB
/
.envrc.use_pep0582.disabled
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# ===========================================================================
# PROJECT ENVIRONMENT SETUP: .envrc.use_pep0582
# ===========================================================================
# DESCRIPTION:
# Setup Python search path to use the PEP-0582 sub-directory tree.
#
# ENABLE/DISABLE THIS OPTIONAL PART:
# * TO ENABLE: Rename ".envrc.use_pep0582.disabled" to ".envrc.use_pep0582"
# * TO DISABLE: Rename ".envrc.use_pep0582" to ".envrc.use_pep0582.disabled"
#
# SEE ALSO:
# * https://direnv.net/
# * https://peps.python.org/pep-0582/ Python local packages directory
# ===========================================================================
if [ -z "${PYTHON_VERSION}" ]; then
# -- AUTO-DETECT: Default Python3 version
# EXAMPLE: export PYTHON_VERSION="3.9"
export PYTHON_VERSION=$(python3 -c "import sys; print('.'.join([str(x) for x in sys.version_info[:2]]))")
fi
echo "USE: PYTHON_VERSION=${PYTHON_VERSION}"
# -- HINT: Support PEP-0582 Python local packages directory (supported by: pdm)
path_add PATH __pypackages__/${PYTHON_VERSION}/bin
path_add PYTHONPATH __pypackages__/${PYTHON_VERSION}/lib
# -- SIMILAR-TO:
# export PATH="${HERE}/__pypackages__/${PYTHON_VERSION}/bin:${PATH}"
# export PYTHONPATH="${HERE}:${HERE}/__pypackages__/${PYTHON_VERSION}/lib:${PYTHONPATH}"