-
-
Notifications
You must be signed in to change notification settings - Fork 797
/
Makefile
95 lines (77 loc) · 2.17 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
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
init:
python setup.py install
dev-init:
${pip} install .[dev]
test:
pytest
lint: mypy black flake8 isort
mypy:
mypy \
--disable-error-code "annotation-unchecked" \
--follow-imports=silent \
--ignore-missing-imports \
--implicit-optional \
-p vyper
black:
black -C -t py311 vyper/ tests/ setup.py --force-exclude=vyper/version.py
flake8: black
flake8 --enable-extensions=FS003 vyper/ tests/
isort: black
isort vyper/ tests/ setup.py
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
# To display docs, run:
# open docs/_build/html/index.html (macOS)
# start docs/_build/html/index.html (Windows)
# xdg-open docs/_build/html/index.html (Linux)
release: clean
python setup.py sdist bdist_wheel
twine check dist/*
#twine upload dist/*
freeze: clean init
echo Generating binary...
export OS="$$(uname -s | tr A-Z a-z)" && \
export VERSION="$$(PYTHONPATH=. python vyper/cli/vyper_compile.py --version)" && \
pyinstaller --target-architecture=universal2 --clean --onefile vyper/cli/vyper_compile.py --name "vyper.$${VERSION}.$${OS}" --add-data vyper:vyper
clean: clean-build clean-docs clean-pyc clean-test
clean-build:
@echo Cleaning python build files...
@rm -fr build/
@rm -fr _build/ # docs build dir
@rm -fr dist/
@rm -fr *.egg-info
@rm -f vyper/version.py vyper/vyper_git_version.txt vyper/vyper_git_commithash.txt
@rm -f *.spec
clean-docs:
@echo Cleaning doc build files...
@rm -rf docs/_build/
@rm -f docs/modules.rst
@rm -f docs/vyper.rst
@rm -f docs/vyper.*.rst
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/
@rm -rf .tox/
@rm -fr .mypy_cache/