Commit Graph

2659 Commits

Author SHA1 Message Date
Michal Pokorný (Rai)
ce59fad160 Replace 'var' with 'let' or const as appropriate
Also replaces some for-loops over arrays with for..of loops.
2019-12-20 22:35:37 +01:00
Damien Elmes
ed0b3d3374 add an example of how circular imports can be handled
The type name needs to be quoted so it is evaluated after the module
has been initialized.

In the future when we drop support for python 3.6, and mypy is updated,
we will be able to remove the quotes and use the following at
the top of the file instead:

from __future__ import annotations
2019-12-21 07:29:45 +10:00
Arthur Milchior
e835403b8c add some updateReqs=False in tests 2019-12-20 13:25:30 -08:00
Damien Elmes
981b3f34a0 pytype can't handle circular imports 2019-12-21 07:16:26 +10:00
Ian Goodacre
329ca71436 Use _deckNewLimitSingle in _groupChildrenMain 2019-12-21 09:26:51 +13:00
Damien Elmes
59ce08bc4e add type hints section to README.contributing 2019-12-20 20:52:16 +10:00
Damien Elmes
795f36aeb0 add comment about pretty to makefile 2019-12-20 20:37:29 +10:00
Damien Elmes
94a81230f6 Revert "add arg hints to schedulers"
This reverts commit a02d203604.

no longer needed
2019-12-20 19:44:08 +10:00
Damien Elmes
c1587254f4 use isort to tidy up imports 2019-12-20 19:19:29 +10:00
Damien Elmes
638a8515bc add some typing to addcards and main 2019-12-20 18:43:52 +10:00
Damien Elmes
ddac1dd579 a few more typing fixes 2019-12-20 17:55:19 +10:00
Damien Elmes
12093f2f2e add a bunch of extra hints for mypy 2019-12-20 16:40:20 +10:00
Damien Elmes
d8d7e78b6b remove typings from some other files
not used frequently enough to deal with the mypy errors they're causing
at the moment
2019-12-20 16:33:49 +10:00
Damien Elmes
b6b8df2dcf add a bunch of annotations for mypy 2019-12-20 15:07:40 +10:00
Damien Elmes
068b10103c fix media.check() sig 2019-12-20 11:58:50 +10:00
Damien Elmes
f170763ef1 exporting, latex 2019-12-20 11:47:19 +10:00
Damien Elmes
55795822b5 importing 2019-12-20 11:41:24 +10:00
Damien Elmes
c415a70e72 lang/media/storage 2019-12-20 11:27:01 +10:00
Damien Elmes
f74ee52c73 decks 2019-12-20 11:07:08 +10:00
Damien Elmes
efd78e66ef models 2019-12-20 11:07:08 +10:00
Damien Elmes
6ffe82ac54 db/hooks/utils 2019-12-20 11:07:08 +10:00
Damien Elmes
f69ef52845 collection 2019-12-20 11:07:08 +10:00
Damien Elmes
912e1bad03 cards/notes 2019-12-20 11:07:08 +10:00
Damien Elmes
9c16d59086 type hints for scheduler 2019-12-20 11:07:08 +10:00
Damien Elmes
a02d203604 add arg hints to schedulers 2019-12-20 11:07:08 +10:00
Damien Elmes
6ecfff56c5 add pytype inferred types to anki/
I've corrected some obvious issues, and we can fix others over time.
Mypy tests are currently broken, as adding the type hints has increased
mypy's testing surface.
2019-12-20 11:07:08 +10:00
Damien Elmes
5ff4327db1 pin pyqt version; the just-released 5.14 looks to be broken 2019-12-20 10:44:15 +10:00
Damien Elmes
b5fe37d171 hide errors when sudo required for typecheck setup 2019-12-20 10:39:24 +10:00
Damien Elmes
b55e2e7dfb fix travis again 2019-12-20 10:38:14 +10:00
Damien Elmes
da9426177d typing fixes 2019-12-20 10:21:20 +10:00
Damien Elmes
85c3ca1c39 disable unit test broken by revert 2019-12-20 10:16:17 +10:00
Damien Elmes
a45f029f3e call onExpanded() 2019-12-20 09:30:35 +10:00
Damien Elmes
879db95148 honor expand setting 2019-12-20 09:27:14 +10:00
Damien Elmes
b2ea4ee36c fix click to expand/contract 2019-12-20 08:52:03 +10:00
Damien Elmes
5418af00f7 Revert "DeckManager: _checkDeckTree ignore case"
This reverts commit 9955048aec.

This commit broke collections that had children under each of the
the duplicate names - it renames one of the decks, but the children
of the renamed deck are left without a parent, causing an error like

line 235, in deckDueList  nlim = min(nlim, lims[p][0])\n\nKeyError('..)

Rather than a more complicated approach, I think it's safer just to
leave the case or normalization-differing decks around for now, and
we can normalize things properly in a future schema upgrade.
2019-12-20 08:18:01 +10:00
Damien Elmes
66406110f5 typing tweaks 2019-12-19 21:11:35 +10:00
Damien Elmes
5fbe9ff048 rebuild gui if any icons change 2019-12-19 21:11:27 +10:00
Damien Elmes
867136eace faster sidebar implementation
- qtreewidget is too slow on Qt5
- expanding/collapsing still todo
2019-12-19 21:11:12 +10:00
Damien Elmes
18e60f7678 fix bug in editor ts conversion 2019-12-19 20:53:00 +10:00
Damien Elmes
2155e93bad Revert "add signatures to calling code"
This reverts commit 441e279f6d.

Pytype does catch the mentioned error without the extra annotations.
2019-12-19 11:39:40 +10:00
Damien Elmes
441e279f6d add signatures to calling code
otherwise mypy ignores them. And even then, it's not smart enough
to notice self.mw.pm.setUiScale("foo") is invalid unless the
instance assignment in main has a type hint as well
2019-12-19 11:34:46 +10:00
Damien Elmes
3a4f94ab86 add UI scale preference 2019-12-19 09:58:16 +10:00
Damien Elmes
5ce3de0e98 setup profile earlier in startup, but defer warning message until qt init 2019-12-19 09:38:36 +10:00
Damien Elmes
c61bc8859c split qt requirements out again
PyQt didn't used to split WebEngine out separately, and that can
cause conflicts with distro-provided packages.
2019-12-19 09:34:31 +10:00
Damien Elmes
06b2cb1875 update make instructions 2019-12-19 07:46:25 +10:00
Damien Elmes
99502e20ea ignore buildhash when checking if tests need to be re-run 2019-12-18 21:06:47 +10:00
Damien Elmes
901c285a12 use single .gitignore file 2019-12-18 21:06:24 +10:00
Damien Elmes
c15f71071e fix broken js building
- deps need to be defined before used
- incremental builds were not working properly
2019-12-18 17:56:58 +10:00
Damien Elmes
aab765292a individual build rules need to depend on prereqs 2019-12-18 17:28:23 +10:00
Damien Elmes
71c0e23b77 do typecheck setup as part of prereqs install 2019-12-18 17:18:24 +10:00