-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (78 loc) · 2.05 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
SHELL := /bin/bash
ifeq (, $(shell which pip3))
pip := $(shell which pip3)
else
pip := $(shell which pip)
endif
.PHONY: test dev-deps lint clean clean-pyc clean-build clean-test docs docker-build
init:
${pip} install .
dev-deps:
${pip} install .[test,lint]
test:
python setup.py test
lint:
tox -e lint
clean: clean-build clean-pyc clean-test
clean-build:
@echo Cleaning python build files...
@rm -fr build/
@rm -fr dist/
@rm -fr *.egg-info
clean-pyc:
@echo Cleaning python files...
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
@find . -name '__pycache__' -exec rmdir {} +
clean-test:
@echo Cleaning test files...
@find . -name 'htmlcov' -exec rm -rf {} +
@rm -fr coverage.xml
@rm -fr .coverage
@rm -fr .eggs/
@rm -fr .hypothesis/
@rm -fr .pytest_cache/
docs:
rm -f docs/vyper.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ -d 2 vyper/
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html
docker-build:
@docker build -t vyper \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` .
# Get the part number from the built docker image, before the '+' symbol
docker-release:
docker login
docker tag vyper vyperlang/vyper:latest
docker push vyperlang/vyper:latest
docker tag vyper vyperlang/vyper:$(firstword $(subst +, ,$(shell docker run vyper --version)))
docker push vyperlang/vyper:$(firstword $(subst +, ,$(shell docker run vyper --version)))
# Asks to bump the dev partnumber
# TODO Use semver automatic versioning via git log
git-tag:
@echo -n "Bump the part number? [y/N]: "
@read line; if [ $$line == "y" ]; then \
bumpversion devnum; \
git push upstream && git push upstream --tags; \
fi
pypi-build:
python setup.py sdist bdist_wheel
pypi-release:
twine check dist/*
twine upload dist/*
release: clean
ifndef SKIP_TAG
$(MAKE) git-tag
endif
ifndef SKIP_DOCKER
$(MAKE) docker-build
$(MAKE) docker-release
endif
ifndef SKIP_PYPI
$(MAKE) pypi-build
$(MAKE) pypi-release
endif