-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
88 lines (63 loc) · 2.06 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Setup the environment
SYSTEM_DEPENDENCIES := poetry==1.1.3 pre-commit coveralls flake8
.PHONY: check-py3
check-py3:
./utility-scripts/check_python37.sh
.PHONY: install-system-python-deps
install-system-python-deps:
pip install -U $(SYSTEM_DEPENDENCIES)
.PHONY: install-system-python-deps
install-system-python-deps-user:
pip install --user -U $(SYSTEM_DEPENDENCIES)
## To install system level dependencies
.PHONY: install-system-deps
install-system-deps: check-py3 install-system-python-deps
## Setup poetry
.PHONY: poetry-setup
poetry-setup:
poetry config virtualenvs.in-project true
poetry run pip install pip==20.0.2
poetry install
## Setup pre-commit
.PHONY: pre-commit-setup
pre-commit-setup:
pre-commit install
# Setup virtual environment and dependencies
.PHONY: install-deps
install-deps: pre-commit-setup poetry-setup
# Format code
.PHONY: code-format
code-format:
# calling make _format within poetry make it so that we only init poetry once
poetry run isort -rc -y src/genos tests
poetry run black src/genos tests
# Flake8 to check code formatting
.PHONY: quality-check
quality-check:
poetry run flake8 src/genos tests
# Run tests
.PHONY: unit-test
unit-test:
PYTHONPATH='./src/' poetry run pytest tests/ -s
# Run coverage
.PHONY: coverage
coverage:
PYTHONPATH='./src/' poetry run coverage run --concurrency=multiprocessing -m pytest tests/ -s
poetry run coverage combine
poetry run coverage report -m
# Run tests and coverage
.PHONY: test-coverage
test-coverage: unit-test coverage
.PHONY: verify-version-tag
verify-version-tag:
PYTHONPATH='./src/' poetry run python setup.py verify
.PHONY: package-upload
package-upload:
if [ -d "./build" ]; then rm -rf "./build"; fi
if [ -d "./dist" ]; then rm -rf "./dist"; fi
if [ -d "./src/panini.egg-info" ]; then rm -rf "./src/panini.egg-info"; fi
PYTHONPATH=./src poetry run python setup.py sdist bdist_wheel
poetry run twine upload dist/*
if [ -d "./build" ]; then rm -rf ./build; fi
if [ -d "./dist" ]; then rm -rf ./dist; fi
if [ -d "./src/panini.egg-info" ]; then rm -rf ./src/panini.egg-info; fi