-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (41 loc) · 1.37 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
include ./VERSION
default: all
all: zip ankiweb
generated: src/version.py src/config.py src/schema.py
zip: generated vendor
python -m ankiscripts.build --type package --qt all --exclude user_files/**/*
ankiweb: generated vendor build/ankiweb-description.md
python -m ankiscripts.build --type ankiweb --qt all --exclude user_files/**/*
build/ankiweb-description.md: description.md CHANGELOG.md
cat description.md CHANGELOG.md >$@
src/version.py: ./VERSION
@echo "__version__ = '$(VERSION)'" >$@
src/config.py: ./src/config.schema.json
datamodel-codegen \
--input=$< \
--input-file-type=jsonschema \
--output-model-type=typing.TypedDict \
| sed -e "s/ /\t/g" >$@
src/schema.py: ./src/config.schema.json
python3 ./tools/json2python.py <$< >$@
src/basic_names.py:
sh ./tools/get-basic-notetype-names.sh >$@
vendor:
python -m ankiscripts.vendor
fix:
python -m yapf src --recursive --in-place
python -m isort src
mypy:
# See https://github.com/python/mypy/issues/8727
-python -m mypy src --exclude=src/vendor --exclude=src/forms \
--check-untyped-defs --disable-error-code name-defined
pylint:
-python -m pylint src
lint: mypy pylint
test:
python -m pytest --cov=src --cov-config=.coveragerc
sourcedist:
python -m ankiscripts.sourcedist
clean:
rm -rf build/ src/version.py src/config.py
.PHONY: all zip ankiweb vendor fix mypy pylint lint test sourcedist clean