forked from Synerty/wstools-py3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (51 loc) · 1.96 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
all: clean flake8 test pypi docs tag release
.PHONY: all docs
PACKAGE_NAME=$(shell python setup.py --name)
PYTHON_VERSION=$(shell python -c "import sys; print('py%s%s' % sys.version_info[0:2])")
PYTHON_PATH=$(shell which python)
PLATFORM=$(shell uname -s | awk '{print tolower($0)}')
DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PYENV_HOME := $(DIR)/.tox/$(PYTHON_VERSION)-$(PLATFORM)/
clean:
find . -name "*.pyc" -delete
package:
python setup.py sdist bdist_wheel build_sphinx
install: prepare
$(PYENV_HOME)/bin/python setup.py install
uninstall:
$(PYENV_HOME)/bin/pip uninstall -y $(PACKAGE_NAME)
venv: $(PYENV_HOME)/bin/activate
# virtual environment depends on requriements files
$(PYENV_HOME)/bin/activate: requirements*.txt
@echo "INFO: (Re)creating virtual environment..."
test -d $(PYENV_HOME)/bin/activate || virtualenv --python=$(PYTHON_PATH) --system-site-packages $(PYENV_HOME)
$(PYENV_HOME)/bin/pip install -q -r requirements.txt
$(PYENV_HOME)/bin/pip install -q -r requirements-dev.txt
touch $(PYENV_HOME)/bin/activate
prepare: venv
@echo "INFO: === Prearing to run for package:$(PACKAGE_NAME) platform:$(PLATFORM) py:$(PYTHON_VERSION) dir:$(DIR) ==="
testspace:
${HOME}/testspace/testspace publish build/results.xml
flake8:
$(PYENV_HOME)/bin/python -m flake8
$(PYENV_HOME)/bin/python -m flake8 --install-hook 2>/dev/null || true
test: prepare flake8
$(PYENV_HOME)/bin/python setup.py test
test-all:
# tox should not run inside virtualenv because it does create and use multiple virtualenvs
pip install -q tox tox-pyenv
python -m tox --skip-missing-interpreters true
pypi:
$(PYENV_HOME)/bin/python setup.py check --restructuredtext --strict
$(PYENV_HOME)/bin/python setup.py sdist bdist_wheel upload
pypitest:
$(PYENV_HOME)/bin/python setup.py check --restructuredtext --strict
$(PYENV_HOME)/bin/python setup.py sdist bdist_wheel upload -r pypitest
tag:
bumpversion minor
git push origin master
git push --tags
release:
tag
pypi
web