-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (35 loc) · 1.03 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
.PHONY: build
build: setup.py
python3 -m pip install --upgrade build && python3 -m build
.PHONY: upload
upload:
python3 -m twine upload --repository pypi dist/*
.PHONY: upload-test
upload-test:
python3 -m twine upload --repository testpypi dist/*
.PHONY: clean
clean:
rm -rf build dist
line_len = 120
line_len_arg = --line-length $(line_len)
code_folders = ./
# Format source code automatically
.PHONY: format
format:
black $(line_len_arg) -t py38 $(code_folders)
isort $(line_len_arg) --py 38 --profile black $(code_folders)
# Check that source code meets quality standards
.PHONY: check-codestyle
check-codestyle:
black --check $(line_len_arg) -t py38 $(code_folders)
isort --check-only $(line_len_arg) --py 38 --profile black $(code_folders)
# ignore some formatting issues already covered by black
flake8 --max-line-length $(line_len) --ignore=E501,F401,E203,W503,E126,E722 $(code_folders)
# Run tests for the library
.PHONY: test
test:
pytest -s
# Run code coverage test
.PHONY: test-cov
test-cov:
pytest --cov=./ -v