~hristoast/mousikofidi

ref: 95561a312cc1a94d166c7468fc214e2ece047ad1 mousikofidi/Makefile -rw-r--r-- 2.2 KiB
95561a31Hristos N. Triantafillou Showing errors in the UI is optional, default: off (#143) 9 months ago
                                                                                
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
proj_dir := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

.DEFAULT_GOAL:= server

annotations:
	annotatepy $(proj_dir)/mousikofidi > $(proj_dir)/annotations.json

clean: githooks
	rm -fr $(proj_dir)/__pycache__ \
    $(proj_dir)/annotations.json \
    $(proj_dir)/mousikofidi/__pycache__ \
    $(proj_dir)/.pytest_cache \
    $(proj_dir)/MousikoFidi.egg-info \
    $(proj_dir)/build $(proj_dir)/dist

githooks:
	$(proj_dir)/pre-commit.sh --install

install:
	python3 -m pip install --user --upgrade $(proj_dir)

install-global:
	python3 -m pip install --upgrade $(proj_dir)

uninstall:
	python3 -m pip uninstall MousikoFidi

distribution-archive:
	cd $(proj_dir) && python3 setup.py sdist bdist_wheel

upload-distribution-archive-test:
	test -d $(proj_dir)/dist || exit 1
	cd $(proj_dir) && twine upload --repository-url https://test.pypi.org/legacy/ dist/*

upload-distribution-archive:
	@test -d $(proj_dir)/dist || exit 1
	cd $(proj_dir) && twine upload dist/*

all-requirements: requirements dev-requirements

requirements:
	python3 -m pip install --user -r $(proj_dir)/requirements.txt

dev-requirements: githooks
	python3 -m pip install --user -r $(proj_dir)/dev-requirements.txt

test: githooks test-black test-flake8 test-pytest

# TODO: read an env var to decide if we are quiet or verbose
test-verbose: githooks test-black-verbose test-flake8-verbose test-pytest-verbose

test-quiet: githooks test-black-quiet test-flake8-quiet test-pytest-quiet

test-black:
	black --check $(proj_dir)

test-black-quiet:
	@black --quiet --check $(proj_dir)

test-black-verbose:
	black --verbose --check $(proj_dir)

test-flake8:
	flake8 $(proj_dir)

test-flake8-quiet:
	@flake8 --quiet $(proj_dir)

test-flake8-verbose:
	flake8 --verbose $(proj_dir)

test-pytest:
	FIDI_CFG=$(proj_dir)/mousikofidi/example/fidi.toml pytest $(proj_dir)

test-pytest-quiet:
	@FIDI_CFG=$(proj_dir)/mousikofidi/example/fidi.toml pytest --quiet $(proj_dir)

test-pytest-verbose:
	FIDI_CFG=$(proj_dir)/mousikofidi/example/fidi.toml pytest --verbosity=2 $(proj_dir)

server: dev-server

dev-server:
	FLASK_APP=$(proj_dir)/mousikofidi.py FLASK_ENV=development flask run

uwsgi-server:
	uwsgi --processes $(shell nproc) --chdir $(proj_dir) --ini $(proj_dir)/example/uwsgi.ini