-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile-local.defs
42 lines (33 loc) · 1.23 KB
/
makefile-local.defs
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
36
37
38
39
40
41
42
# Definitions for local development
install_trunk:
$(eval trunk_installed=$(shell trunk --version > /dev/null 2>&1 ; echo $$? ))
ifneq (${trunk_installed},0)
$(eval OS_NAME=$(shell uname -s | tr A-Z a-z))
curl https://get.trunk.io -fsSL | bash
endif
uninstall_trunk:
sudo rm -if `which trunk`
rm -ifr ${HOME}/.cache/trunk
configure_pyright:
trunk actions run configure-pyright
create_env:
# Copy .env
cp .env.example .env
setup: install_trunk create_env ## Sets up a local dev environment using Poetry
# Install pip
pip install --upgrade pip
# Install poetry & dependencies
pip install "poetry==1.8.1"
poetry install
make configure_pyright
setup_with_pyenv: install_trunk create_env ## Sets up a local dev environment using Pyenv
$(eval venv_name=$(shell grep 'venv =' pyproject.toml | cut -d '"' -f 2 ))
if [ -n "$(venv_name)" ] && ! pyenv versions --bare | grep -q "^$(venv_name)$$"; then \
$(eval python_version=$(shell grep 'python =' pyproject.toml | cut -d '"' -f 2 | sed 's/^\^//')) \
$(eval pyenv_version=$(shell pyenv versions --bare | grep$(python_version) )) \
pyenv virtualenv $(pyenv_version) $(venv_name); \
fi
@eval "$$(pyenv init -)" && \
pyenv activate $(venv_name) && \
poetry install
make configure_pyright