-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (36 loc) · 1.15 KB
/
Makefile
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
43
SHELL=/bin/bash
VENV_NAME := $(shell [ -d venv ] && echo venv || echo .venv)
VENV_DIR=${VENV_NAME}
PYTHON=$(shell if [ -d $(VENV_DIR) ]; then echo $(VENV_DIR)/bin/python; else echo python; fi)
ifneq (,$(findstring xterm,${TERM}))
BOLD := $(shell tput -Txterm bold)
RED := $(shell tput -Txterm setaf 1)
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
NORMAL := $(shell tput -Txterm sgr0)
endif
install:
@echo "${BOLD}${YELLOW}install:${NORMAL}"
pipx install uv
pipx upgrade uv
@if [ ! -d "$(VENV_DIR)" ]; then \
python3.12 -m venv $(VENV_DIR); \
fi
@. $(VENV_DIR)/bin/activate; \
uv pip install -r requirements.txt
build:
@echo "${BOLD}${YELLOW}mkdocs build:${NORMAL}"
${PYTHON} -m mkdocs build -s
run:
@echo "${BOLD}${YELLOW}mkdocs serve:${NORMAL}"
${PYTHON} -m mkdocs serve --dirty
update-venv:
@echo "${BOLD}${YELLOW}update venv:${NORMAL}"
${PYTHON} -m pip install -U pip
uv pip install -Ur requirements.txt
ci-install:
${PYTHON} -m pip install -U pip
${PYTHON} -m pip install -U uv
UV_SYSTEM_PYTHON=true uv pip install -Ur requirements.txt
echo -e "\nInstalled packages:"
uv pip list