-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
82 lines (62 loc) · 1.77 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
VENV_NAME=venv
PIP=$(VENV_NAME)/bin/pip
TOX=`which tox`
PYTHON=$(VENV_NAME)/bin/python
ISORT=$(VENV_NAME)/bin/isort
FLAKE8=$(VENV_NAME)/bin/flake8
TWINE=`which twine`
SOURCES=kivymd/ demos/ setup.py
# using full path so it can be used outside the root dir
SPHINXBUILD=$(shell realpath venv/bin/sphinx-build)
DOCS_DIR=doc
SYSTEM_DEPENDENCIES= \
libpython$(PYTHON_VERSION)-dev \
libsdl2-dev \
tox \
virtualenv
OS=$(shell lsb_release -si)
PYTHON_MAJOR_VERSION=3
PYTHON_MINOR_VERSION=6
PYTHON_VERSION=$(PYTHON_MAJOR_VERSION).$(PYTHON_MINOR_VERSION)
PYTHON_WITH_VERSION=python$(PYTHON_VERSION)
all: system_dependencies virtualenv
venv:
test -d venv || virtualenv -p $(PYTHON_WITH_VERSION) venv
virtualenv: venv
$(PIP) install Cython==0.28.6
$(PIP) install -r requirements.txt
virtualenv-test: virtualenv
$(PIP) install -r requirements/requirements-test.txt
system_dependencies:
ifeq ($(OS), Ubuntu)
sudo apt install --yes --no-install-recommends $(SYSTEM_DEPENDENCIES)
endif
run/linux: virtualenv
PYTHONPATH=. $(PYTHON) demos/kitchen_sink/main.py
run: run/linux
test:
$(TOX)
lint/isort-check: virtualenv-test
$(ISORT) --check-only --recursive --diff $(SOURCES)
lint/isort-fix: virtualenv-test
$(ISORT) --recursive $(SOURCES)
lint/flake8: virtualenv-test
$(FLAKE8) $(SOURCES)
lint: lint/isort-check lint/flake8
docs/clean:
rm -rf $(DOCS_DIR)/build/
docs:
cd $(DOCS_DIR) && SPHINXBUILD=$(SPHINXBUILD) make html
release/clean:
rm -rf dist/ build/
release/build: release/clean
$(PYTHON) setup.py sdist bdist_wheel
$(TWINE) check dist/*
release/upload:
$(TWINE) upload dist/*
clean: release/clean docs/clean
py3clean kivymd/
find kivymd/ -type d -name "__pycache__" -exec rm -r {} +
find . -type d -name "*.egg-info" -exec rm -r {} +
clean/all: clean
rm -rf $(VENV_NAME) .tox/