-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 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
45
46
47
48
49
POETRY=poetry
POETRY_RUN=$(POETRY) run
SOURCE_FILES=$(shell find . -path "./get_metars/*.py")
TEST_FILES=$(shell find . -path "./tests/*.py")
SOURCES_FOLDER=get_metars
TESTS_FOLDER=tests
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
check_no_main:
ifeq ($(BRANCH),main)
echo "You are good to go!"
else
$(error You are not in the main branch)
endif
patch: check_no_main
$(POETRY_RUN) bumpversion patch --verbose
git push --follow-tags
minor: check_no_main
$(POETRY_RUN) bumpversion minor --verbose
git push --follow-tags
major: check_no_main
$(POETRY_RUN) bumpversion major --verbose
git push --follow-tags
style:
$(POETRY_RUN) isort $(SOURCES_FOLDER)
$(POETRY_RUN) isort $(TESTS_FOLDER)
$(POETRY_RUN) black $(SOURCE_FILES)
$(POETRY_RUN) black $(TEST_FILES)
lint:
$(POETRY_RUN) isort $(SOURCES_FOLDER) --check-only
$(POETRY_RUN) isort $(TESTS_FOLDER) --check-only
$(POETRY_RUN) black $(SOURCE_FILES) --check
$(POETRY_RUN) black $(TEST_FILES) --check
test:
$(POETRY_RUN) pytest $(TESTS_FOLDER)
test-verbose:
$(POETRY_RUN) pytest $(TESTS_FOLDER) -vv
run:
$(POETRY_RUN) python -m $(SOURCES_FOLDER)