-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (43 loc) · 1.08 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
# build the wheel file
build:
python -m build
# build into binary files
bin:
cd ./src &&\
python setup.py build_ext --inplace
# clean all the generated files
clean:
make clean_temp
rm -rf dist
# clean all the temporary files
clean_temp:
rm -rf ./src/build
rm -rf src/*.egg-info
rm -rf */__pycache__
rm -rf src/*.pyi
rm -rf src/*/__pycache__
rm -rf src/*/*.c
rm -rf src/*/*.pyd
rm -rf src/*/*.pyi
# Run unit test
test:
python -m unittest
# check code
# flake8: pip install flake8
lint:
make format
flake8 --ignore=E501,E203 src/ tests/ examples/ --count --statistics --exclude=src/*/__init__.py
# only check Error(E) and Fatal(F)
error:
make format
flake8 --select E,F --ignore=E501,E203 src/ tests/ examples/ --count --statistics --exclude=src/*/__init__.py
# formatters choices:black,autopep8,prettier,yapf
format:
black src/ tests/ examples/
# generate files for IDE's code hint if replacing .py files with .pyd files
# pip install mypy
stub:
stubgen src/ -o src/
# Run multiple make commands. Please put them in a row
# all:clean bin build clean_temp
all:error stub bin build