-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (60 loc) · 1.9 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
70
71
72
73
74
# vim: noexpandtab filetype=make
.PHONY: help update test lint all build publish-test publish clean clean-build clean-pyc
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3
.DEFAULT: help
help:
@echo "make all"
@echo " prepare development environment, lint and test"
@echo "make venv"
@echo " prepare development environment"
@echo "make test"
@echo " run tests"
@echo "make lint"
@echo " run pylint"
@echo "make clean"
@echo " remove all development files and directories"
@echo "make build"
@echo " build distribution packages"
@echo "make publish-test"
@echo " upload distribution archives to TestPyPI"
@echo "make publish"
@echo " upload distribution archives to PyPI"
# Requirements are in setup.py, so whenever setup.py is changed, re-run installation of dependencies.
venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate: setup.py
test -d $(VENV_NAME) || python3 -m venv $(VENV_NAME)
${PYTHON} -m pip install -U pip
${PYTHON} -m pip install -e '.[dev]'
touch $(VENV_NAME)/bin/activate
update: venv
${PYTHON} -m pip install -e '.[dev]'
test: venv update
${PYTHON} -m pytest -v -x
lint: venv
${PYTHON} -m pylint universal_tsdb tests
all: lint test
${PYTHON} -m pip install -e '.[dev]'
build: venv
${PYTHON} -m pip install -U setuptools wheel
${PYTHON} setup.py sdist bdist_wheel
publish-test: venv build
${PYTHON} -m pip install -U twine
${PYTHON} -m twine upload https://test.pypi.org/legacy/ dist/*
publish: venv build
${PYTHON} -m pip install -U twine
${PYTHON} -m twine upload dist/*
clean: clean-build clean-pyc
rm -rf venv
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -delete
clean-pyc:
find . -name '*.pyc' -delete
find . -name '*.pyo' -delete
find . -name '*~' -delete
find . -name '__pycache__' -exec rm -fr {} +