mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
give up on pytype
the fix/check/fix cycle is infuriating slow
This commit is contained in:
parent
f8419cf957
commit
f2a7e4685c
2 changed files with 1 additions and 16 deletions
11
Makefile
11
Makefile
|
@ -66,10 +66,6 @@ RUNREQS := .build/pyrunreqs .build/jsreqs
|
||||||
./tools/typecheck-setup.sh
|
./tools/typecheck-setup.sh
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pytypereqs: .build/pycheckreqs
|
|
||||||
pip install pytype
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
.build/jsreqs: ts/package.json
|
.build/jsreqs: ts/package.json
|
||||||
(cd ts && npm i)
|
(cd ts && npm i)
|
||||||
touch $@
|
touch $@
|
||||||
|
@ -140,15 +136,10 @@ PYCHECKDEPS := $(BUILDDEPS) .build/pycheckreqs $(shell find anki aqt -name '*.py
|
||||||
black --check $(BLACKARGS) # if this fails, run 'make fixpyfmt'
|
black --check $(BLACKARGS) # if this fails, run 'make fixpyfmt'
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
.build/pytype: $(PYCHECKDEPS) .build/pytypereqs
|
.PHONY: mypy pytest pylint pyimports pyfmt
|
||||||
pytype --config pytype.conf
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
.PHONY: mypy pytest pylint pytype pyimports pyfmt
|
|
||||||
mypy: .build/mypy
|
mypy: .build/mypy
|
||||||
pytest: .build/pytest
|
pytest: .build/pytest
|
||||||
pylint: .build/pylint
|
pylint: .build/pylint
|
||||||
pytype: .build/pytype
|
|
||||||
pyimports: .build/pyimports
|
pyimports: .build/pyimports
|
||||||
pyfmt: .build/pyfmt
|
pyfmt: .build/pyfmt
|
||||||
|
|
||||||
|
|
|
@ -54,12 +54,6 @@ but not very good at type inference, so it is mostly useful for checking code
|
||||||
that has type signatures. It is able to read the bundled Qt stubs, and works
|
that has type signatures. It is able to read the bundled Qt stubs, and works
|
||||||
across the whole Anki codebase.
|
across the whole Anki codebase.
|
||||||
|
|
||||||
You can optionally use 'make pytype' to typecheck the code with pytype. Pytype
|
|
||||||
is much slower, but it can catch errors in untyped code that mypy misses. It
|
|
||||||
is not able to check the aqt/* code, as it can't read the Qt stubs, and it is
|
|
||||||
not currently compatible with Python 3.8. It can be difficult to build on
|
|
||||||
some platforms.
|
|
||||||
|
|
||||||
The Qt stubs are not perfect, so you'll find when doing things like connecting
|
The Qt stubs are not perfect, so you'll find when doing things like connecting
|
||||||
signals, you may have to add the following to the end of a line to silence
|
signals, you may have to add the following to the end of a line to silence
|
||||||
the spurious errors.
|
the spurious errors.
|
||||||
|
|
Loading…
Reference in a new issue