-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (24 loc) · 860 Bytes
/
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
SHELL=/bin/bash
PYTHON = python
# will use num_processors - 1 to perform tests in parallel
# (requires pytest-xdist installed)
NUM = $($(shell grep -c ^processor /proc/cpuinfo) \- 1)
all: test build-dist clean
test:
# Create detailed html file. Ignore warnings
${PYTHON} -m pytest tests/*.py \
-ra --html=tests/tests-report.html --self-contained-html -p no:warnings
# run a specific test file:
# python -m pytest tests/<test_filename>.py -n NUM
build-dist:
if [ -d "./dist/*" ]; then \
rm -r ./dist/*; \
fi \
${PYTHON} setup.py develop
${PYTHON} setup.py sdist
${PYTHON} -m pip install ./dist/*.tar.gz
clean:
rm -r .pytest_cache
rm `find ./ -name '__pycache__'` -rf
# Upload on test.py: (to upload on pypi remove '--repository testpypi')
# python -m twine upload --repository testpypi dist/*