-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
69 lines (50 loc) · 1.84 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
# simple makefile to simplify repetitive build env management tasks under posix
# this is adopted from the sklearn Makefile
# caution: testing won't work on windows
PYTHON ?= python
.PHONY: clean develop test install bdist_wheel
clean:
$(PYTHON) setup.py clean
rm -rf dist
rm -rf build
rm -rf .pytest_cache
rm -rf *.egg-info
deploy-requirements:
$(PYTHON) -m pip install twine readme_renderer[md]
# Depends on an artifact existing in dist/, and two environment variables
deploy-twine-test: bdist_wheel deploy-requirements
$(PYTHON) -m twine upload \
--repository-url https://test.pypi.org/legacy/ dist/* \
--username ${TWINE_USERNAME} \
--password ${TWINE_PASSWORD}
doc-requirements:
$(PYTHON) -m pip install -r build_tools/doc/doc_requirements.txt
documentation: doc-requirements
@make -C doc clean html EXAMPLES_PATTERN=example_*
requirements:
$(PYTHON) -m pip install -r requirements.txt
bdist_wheel: requirements
$(PYTHON) setup.py bdist_wheel
sdist: requirements
$(PYTHON) setup.py sdist
develop: requirements
$(PYTHON) setup.py develop
install: requirements
$(PYTHON) setup.py install
test-requirements:
$(PYTHON) -m pip install pytest flake8
coverage-dependencies:
$(PYTHON) -m pip install coverage pytest-cov codecov
test-lint: test-requirements
$(PYTHON) -m flake8 skoot \
--filename='*.py' \
--exclude='skoot/__config__.py,skoot/_build_utils/system_info.py' \
--ignore E803,F401,F403,W293,W504,W605
test-unit: test-requirements coverage-dependencies
$(PYTHON) -m pytest -v --durations=20 --cov-config .coveragerc --cov skoot -p no:logging
test: develop test-unit test-lint
# Coverage creates all these random little artifacts we don't want
rm .coverage.* || echo "No coverage artifacts to remove"
twine-check: bdist_wheel deploy-requirements
# Check that twine will parse the README acceptably
$(PYTHON) -m twine check dist/*