-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (43 loc) · 1.21 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
55
POETRY=poetry
POETRY_RUN=$(POETRY) run
SOURCE_FILES=$(shell find . -name '*.py' -not -path **/.venv/*)
SOURCES_FOLDER=gym_voltorb_flip
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
HASH := $(shell git rev-parse HEAD)
TAG := $(shell git tag -l --contains HEAD)
format:
$(POETRY_RUN) isort -rc $(SOURCES_FOLDER)
$(POETRY_RUN) black $(SOURCE_FILES)
lint:
$(POETRY_RUN) bandit -r $(SOURCES_FOLDER)
$(POETRY_RUN) isort -rc $(SOURCES_FOLDER) --check-only
$(POETRY_RUN) black $(SOURCE_FILES) --check
$(POETRY_RUN) pylint $(SOURCES_FOLDER)
check_on_master:
ifeq ($(BRANCH),master)
echo "You are good to go!"
else
$(error You are not in the master branch)
endif
release: check_on_master
$(POETRY_RUN) bumpversion pre --verbose
git push --follow-tags
patch: check_on_master
$(POETRY_RUN) bumpversion patch --verbose
git push --follow-tags
minor: check_on_master
$(POETRY_RUN) bumpversion minor --verbose
git push --follow-tags
major: check_on_master
$(POETRY_RUN) bumpversion major --verbose
git push --follow-tags
build:
$(POETRY) build
testpypi: build
$(POETRY) publish -r testpypi
publish: build
ifeq ($(TAG),)
@echo "Skipping PyPi publishing"
else
$(POETRY) publish -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD}
endif