-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
62 lines (50 loc) · 1.24 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
SRC = arrayfire_wrapper
ifeq ($(shell uname),Darwin)
ifeq ($(shell which gsed),)
$(error Please install GNU sed with 'brew install gnu-sed')
else
SED = gsed
endif
else
SED = sed
endif
.PHONY : version
version :
@python -c 'from arrayfire_wrapper.version import VERSION; print(f"ArrayFire Python Wrapper v{VERSION}")'
.PHONY : install
install :
pip install --upgrade pip
pip install pip-tools
pip-compile requirements.txt -o final_requirements.txt --allow-unsafe --rebuild --verbose
pip install -r final_requirements.txt
.PHONY : build
build :
python -m build
# Testing
.PHONY : code-style
code-style :
black --check arrayfire_wrapper tests
.PHONY : linting
linting :
flake8 --count --show-source --statistics arrayfire_wrapper tests
.PHONY : import-check
import-check :
isort --check arrayfire_wrapper tests
.PHONY : typecheck
typecheck :
mypy arrayfire_wrapper tests --cache-dir=/dev/null
.PHONY : tests
tests :
pytest --color=yes -v -rf --durations=40 \
--cov-config=.coveragerc \
--cov=$(SRC) \
--cov-report=html
# Cleaning
.PHONY : clean
clean :
rm -rf .pytest_cache/
rm -rf arrayfire_wrapper.egg-info/
rm -rf dist/
rm -rf build/
rm final_requirements.txt
find . | grep -E '(\.mypy_cache|__pycache__|\.pyc|\.pyo$$)' | xargs rm -rf