forked from AndreMiras/QrScan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (52 loc) · 1.63 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
VIRTUAL_ENV ?= venv
ACTIVATE_PATH=$(VIRTUAL_ENV)/bin/activate
PIP=$(VIRTUAL_ENV)/bin/pip
PYTHON=$(VIRTUAL_ENV)/bin/python
ISORT=$(VIRTUAL_ENV)/bin/isort
FLAKE8=$(VIRTUAL_ENV)/bin/flake8
TWINE=`which twine`
SOURCES=src/ setup.py
SYSTEM_DEPENDENCIES= \
libzbar-dev \
virtualenv
PYTHON_VERSION=3.8
PYTHON_WITH_VERSION=python$(PYTHON_VERSION)
all: system_dependencies virtualenv
$(VIRTUAL_ENV):
$(PYTHON_WITH_VERSION) -m venv $(VIRTUAL_ENV)
virtualenv: $(VIRTUAL_ENV)
$(PIP) install Cython==0.28.6
$(PIP) install -r requirements.txt
virtualenv/test: virtualenv
$(PIP) install -r requirements/requirements-test.txt
system_dependencies:
apt install --yes --no-install-recommends $(SYSTEM_DEPENDENCIES)
run/linux: virtualenv
# The `--debug` flag is required if you want to see errors printed in your console.
# Otherwise the exception will be only sent to Sentry.
# $(PYTHON) src/qrscan/main.py --debug
$(PYTHON) src/main.py --debug
run: run/linux
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
test: virtualenv/test lint
$(PYTHON) -m unittest discover --start-directory=src/
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
py3clean src/
find src/ -type d -name "__pycache__" -exec rm -r {} +
find src/ -type d -name "*.egg-info" -exec rm -r {} +
clean/venv: clean
rm -rf $(VIRTUAL_ENV)
clean/all: clean clean/venv