forked from Feramance/qBitrr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (36 loc) · 1.1 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
44
.DEFAULT_GOAL := help
PYTHON ?= python
ROOT_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ifneq ($(wildcard $(ROOT_DIR)/.venv/.),)
VENV_PYTHON = $(ROOT_DIR)/.venv/bin/python
else
VENV_PYTHON = $(PYTHON)
endif
define HELP_BODY
Usage:
make <command>
Commands:
reformat Reformat all files being tracked by git.
bumpdeps Run script bumping dependencies.
newenv Create or replace this project's virtual environment.
syncenv Sync this project's virtual environment to Red's latest dependencies.
endef
export HELP_BODY
# Python Code Style
reformat:
pre-commit run --all-files
# Dependencies
bumpdeps:
pip-compile -o requirements.txt --upgrade
pip-compile -o requirements.dev.txt --extra dev --upgrade
pip-compile -o requirements.fast.txt --extra fast --upgrade
pip-compile -o requirements.all.txt --extra all --upgrade
# Development environment
newenv:
$(PYTHON) -m venv --clear .venv
.venv/bin/pip install -U pip setuptools wheel
$(MAKE) syncenv
syncenv:
pip install -Ur requirements.all.txt
help:
@echo "$$HELP_BODY"