-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
59 lines (48 loc) · 1.49 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
56
57
58
59
NAME = centralpy
SRC = ./${NAME}
PROMPT = ${NAME}
## List of makefile targets
## - help : show this help documentation
.PHONY: help
help: makefile
@sed -n 's/^.*##[ ]//p' $<
## - lint : Run pylint on the source code
.PHONY: lint
lint: env
. env/bin/activate && \
python3 -m pylint ${SRC} && \
python3 -m pycodestyle ${SRC} && \
python3 -m pydocstyle ${SRC} && \
python3 -m mypy ${SRC}
## - black : Run black on the source code
.PHONY: black
black: env
. env/bin/activate && python3 -m black ${SRC}
## - env : Set up the virtual environment
env: env/bin/activate
env/bin/activate: requirements.txt requirements-dev.txt
test -d env || python3 -m venv --prompt ${PROMPT} env/
. env/bin/activate && python3 -m pip install -r requirements.txt
touch env/bin/activate
## - test : Run unit tests
.PHONY: test
test:
. env/bin/activate && python3 -m unittest discover -v
## - pypi : Upload packages to PyPI
.PHONY: pypi
pypi: build
. env/bin/activate && twine upload --repository-url https://upload.pypi.org/legacy/ dist/*;
## - pypi_test : Upload packages to PyPI test
.PHONY: pypi_test
pypi_test: build
. env/bin/activate && twine upload --repository-url https://test.pypi.org/legacy/ dist/*
## - build : Build package artifacts
.PHONY: build
build: clean
. env/bin/activate && python3 setup.py sdist bdist_wheel --universal
## - clean : Remove artifacts from package building process
.PHONY: clean
clean:
rm -rf ./dist;
rm -rf ./build;
rm -rf ./*.egg-info