Skip to content

Commit c4710da

Browse files
authored
Merge pull request #60 from has2k1/toplevel-makefile
Add toplevel Makefile
2 parents f157a21 + 6ff5a69 commit c4710da

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Makefile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.PHONY: clean-pyc clean-build clean docs
2+
UNAME := $(shell uname)
3+
4+
ifeq ($(UNAME), Darwin)
5+
BROWSER := open
6+
else
7+
BROWSER := python -mwebbrowser
8+
endif
9+
10+
help:
11+
@echo "clean - remove all build, test, coverage and Python artifacts"
12+
@echo "clean-build - remove build artifacts"
13+
@echo "clean-pyc - remove Python file artifacts"
14+
@echo "clean-test - remove test and coverage artifacts"
15+
@echo "lint - check style with flake8"
16+
@echo "test - run tests quickly with the default Python"
17+
@echo "coverage - check code coverage quickly with the default Python"
18+
@echo "docs - generate Sphinx HTML documentation, including API docs"
19+
@echo "cdocs - cleanout previous build & generate Sphinx HTML documentation, including API docs"
20+
@echo "release - package and upload a release"
21+
@echo "dist - package"
22+
@echo "install - install the package to the active Python's site-packages"
23+
@echo "develop - install the package in development mode"
24+
25+
clean: clean-build clean-pyc clean-test docs-clean
26+
27+
clean-build:
28+
rm -fr build/
29+
rm -fr dist/
30+
rm -fr .eggs/
31+
find . -name '*.egg-info' -exec rm -fr {} +
32+
find . -name '*.egg' -exec rm -f {} +
33+
34+
clean-pyc:
35+
find . -name '*.pyc' -exec rm -f {} +
36+
find . -name '*.pyo' -exec rm -f {} +
37+
find . -name '*~' -exec rm -f {} +
38+
find . -name '__pycache__' -exec rm -fr {} +
39+
40+
clean-test:
41+
rm -f .coverage
42+
rm -f coverage.xml
43+
rm -fr htmlcov/
44+
45+
lint:
46+
flake8 vetiver
47+
48+
test: clean-test
49+
pytest
50+
51+
coverage:
52+
coverage report -m
53+
coverage html
54+
$(BROWSER) htmlcov/index.html
55+
56+
cdocs cdoc cdocumentation: docs-clean docs
57+
58+
docs-clean:
59+
$(MAKE) -C docs clean
60+
61+
docs doc documentation:
62+
$(MAKE) -C docs html
63+
$(BROWSER) docs/_build/html/index.html
64+
65+
release: dist
66+
twine upload dist/*
67+
68+
dist: clean
69+
python setup.py sdist
70+
71+
install: clean
72+
python setup.py install
73+
74+
develop: clean-pyc
75+
python setup.py develop

0 commit comments

Comments
 (0)