-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
54 lines (44 loc) · 1.26 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
45
46
47
48
49
50
51
52
53
54
.DEFAULT_GOAL := help
PYTHON ?= python3
POETRY ?= poetry
PRECOMMIT ?= pre-commit
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ifneq ($(wildcard $(ROOT_DIR)/venv/.),)
VENV_PYTHON = $(ROOT_DIR)/venv/bin/python
VENV_POETRY = $(ROOT_DIR)/venv/bin/poetry
VENV_PRECOMMIT = $(ROOT_DIR)/venv/bin/pre-commit
else
VENV_PYTHON = $(PYTHON)
VENV_POETRY = $(POETRY)
VENV_PRECOMMIT = $(PRECOMMIT)
endif
define HELP_BODY
Usage:
make <command>
Commands:
reformat Reformat all staged files being tracked by git.
full-reformat Reformat all files being tracked by git.
bumpdeps Run's Poetry up
bump Bump the packages version
syncenv Sync this project's virtual environment to Red's latest dependencies.
lock Update the Poetry.lock file
plugins Install all necesarry Poetry Plugins
endef
export HELP_BODY
# Python Code Style
reformat:
$(VENV_PRECOMMIT) run
full-reformat:
$(VENV_PRECOMMIT) run --all
# Poetry
bumpdeps:
$(VENV_POETRY) up --latest
syncenv:
$(VENV_POETRY) install
lock:
$(VENV_POETRY) lock
bump:
$(VENV_POETRY) dynamic-versioning
plugins:
$(VENV_POETRY) self add "poetry-dynamic-versioning[plugin]"
$(VENV_POETRY) self add "poetry-plugin-up"