mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
fix race condition in build scripts
- pip dependencies need to be installed sequentially - move the individual check deps back into a separate file - qt type hints not required for 'make run'
This commit is contained in:
parent
7399e0bd2b
commit
291472b52b
2 changed files with 21 additions and 28 deletions
44
Makefile
44
Makefile
|
@ -54,30 +54,18 @@ uninstall:
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
######################
|
######################
|
||||||
|
|
||||||
REQS := .build/pyrunreqs .build/jsreqs
|
RUNREQS := .build/pyrunreqs .build/jsreqs
|
||||||
|
|
||||||
.build/pyrunreqs: requirements.txt
|
.build/pyrunreqs: requirements.txt
|
||||||
|
pip install -r $<
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.build/pycheckreqs: requirements.check .build/pyrunreqs
|
||||||
pip install -r $<
|
pip install -r $<
|
||||||
./tools/typecheck-setup.sh
|
./tools/typecheck-setup.sh
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pytest-deps:
|
.build/pytypereqs: .build/pycheckreqs
|
||||||
pip install nose mock
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
.build/mypy-deps:
|
|
||||||
pip install mypy==0.750
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
.build/pylint-deps:
|
|
||||||
pip install pylint
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
.build/pyimport-deps:
|
|
||||||
pip install isort
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
.build/pytype-deps:
|
|
||||||
pip install pytype
|
pip install pytype
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
@ -96,11 +84,11 @@ JSDEPS := $(patsubst ts/src/%.ts, web/%.js, $(TSDEPS))
|
||||||
|
|
||||||
BUILDDEPS := .build/ui .build/js
|
BUILDDEPS := .build/ui .build/js
|
||||||
|
|
||||||
.build/ui: $(REQS) $(shell find designer -type f)
|
.build/ui: $(RUNREQS) $(shell find designer -type f)
|
||||||
./tools/build_ui.sh
|
./tools/build_ui.sh
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/js: $(REQS) $(TSDEPS)
|
.build/js: $(RUNREQS) $(TSDEPS)
|
||||||
(cd ts && npm run build)
|
(cd ts && npm run build)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
@ -129,26 +117,26 @@ check: mypy pyimports pytest pylint checkpretty
|
||||||
# Checking python
|
# Checking python
|
||||||
######################
|
######################
|
||||||
|
|
||||||
PYCHECKDEPS := $(BUILDDEPS) $(shell find anki aqt -name '*.py' | grep -v buildhash.py)
|
PYCHECKDEPS := $(BUILDDEPS) .build/pycheckreqs $(shell find anki aqt -name '*.py' | grep -v buildhash.py)
|
||||||
|
|
||||||
.build/mypy: .build/mypy-deps $(PYCHECKDEPS)
|
.build/mypy: $(PYCHECKDEPS)
|
||||||
mypy anki aqt
|
mypy anki aqt
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pytest: .build/pytest-deps $(PYCHECKDEPS)
|
.build/pytest: $(PYCHECKDEPS)
|
||||||
./tools/tests.sh
|
./tools/tests.sh
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pylint: .build/pylint-deps $(PYCHECKDEPS)
|
.build/pylint: $(PYCHECKDEPS)
|
||||||
pylint -j 0 --rcfile=.pylintrc -f colorized --extension-pkg-whitelist=PyQt5 anki aqt
|
pylint -j 0 --rcfile=.pylintrc -f colorized --extension-pkg-whitelist=PyQt5 anki aqt
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pytype: .build/pytype-deps $(PYCHECKDEPS)
|
.build/pyimports: $(PYCHECKDEPS)
|
||||||
pytype --config pytype.conf
|
isort -rc anki aqt --check # if this fails, run 'make fixpyimports'
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pyimports: .build/pyimport-deps $(PYCHECKDEPS)
|
.build/pytype: $(PYCHECKDEPS) .build/pytypereqs
|
||||||
isort -rc anki aqt --check # if this fails, run 'make fixpyimports'
|
pytype --config pytype.conf
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.PHONY: mypy pytest pylint pytype pyimports fixpyimports
|
.PHONY: mypy pytest pylint pytype pyimports fixpyimports
|
||||||
|
|
5
requirements.check
Normal file
5
requirements.check
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
nose
|
||||||
|
mock
|
||||||
|
mypy==0.750
|
||||||
|
pylint
|
||||||
|
isort
|
Loading…
Reference in a new issue