-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdirenvrc
37 lines (30 loc) · 980 Bytes
/
direnvrc
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
30
31
32
33
34
35
layout_poetry() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use `poetry new` or `poetry init` to create one first.'
exit 2
fi
local VENV=$(dirname $(poetry run which python))
export VIRTUAL_ENV=$(echo "$VENV" | rev | cut -d'/' -f2- | rev)
export POETRY_ACTIVE=1
PATH_add "$VENV"
}
layout_pdm() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use `pdm new` or `pdm init` to create one first.'
exit 2
fi
local VENV=$(dirname $(pdm run which python))
export VIRTUAL_ENV=$(echo "$VENV" | rev | cut -d'/' -f2- | rev)
export PDM_ACTIVE=1
PATH_add "$VENV"
}
layout_hatch() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use `hatch new` or `hatch init` to create one first.'
exit 2
fi
local VENV=$(dirname $(hatch run which python))
export VIRTUAL_ENV=$(echo "$VENV" | rev | cut -d'/' -f2- | rev)
export HATCH_ACTIVE=1
PATH_add "$VENV"
}