This repository was archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (45 loc) · 1.27 KB
/
Makefile
File metadata and controls
58 lines (45 loc) · 1.27 KB
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
include Makefile.config
-include Makefile.custom.config
.SILENT:
check: type-check lint test
clean:
rm -rf .mypy_cache
rm -rf .pytest_cache
clean-all: clean
rm -fr $(VENV)
rm -fr *.egg-info
rm -fr .eggs
rm -fr build
rm -rf dist
rm -rf *.log
create-mastodon-cli:
$(PYTHON) $(FLASK_APP)/utils/create_mastodon_client.py
html:
rm -rf docsrc/build
rm -rf docs/*
touch docs/.nojekyll
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cp -a docsrc/build/html/. docs
install: venv
$(PIP) install -e .[test,doc]
test -e $(FLASK_APP)/config.yml || cp $(FLASK_APP)/config.example.yml $(FLASK_APP)/config.yml
lint:
$(PYTEST) --isort --black -m "isort or black" $(FLASK_APP)
echo 'Running flake8...'
$(FLAKE8) $(FLASK_APP)
lint-fix:
$(BLACK) $(FLASK_APP)
serve:
echo 'Running on http://$(HOST):$(PORT)'
$(FLASK) run --with-threads -h $(HOST) -p $(PORT)
run:
echo 'Running on http://localhost:$(PORT)'
FLASK_ENV=production && $(GUNICORN) -b 127.0.0.1:$(PORT) "$(FLASK_APP):create_app()" --error-logfile $(GUNICORN_LOG)
venv:
test -d $(VENV) || $(PYTHON_VERSION) -m venv $(VENV)
$(PIP) install -U pip setuptools
test:
$(PYTEST) $(FLASK_APP) --cov $(FLASK_APP) --cov-report term-missing $(PYTEST_ARGS)
type-check:
echo 'Running mypy...'
$(MYPY) $(FLASK_APP)