Skip to content

Commit

Permalink
CI: add mypy checks for my.reddit, my.pocket and my.github.ghexport
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Sep 30, 2020
1 parent 0682919 commit 1c20eb2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
9 changes: 9 additions & 0 deletions doc/example_config/my/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ class hypothesis:

class instapaper:
export_path: Paths = ''

class pocket:
export_path: Paths = ''

class github:
export_path: Paths = ''

class reddit:
export_path: Paths = ''
5 changes: 3 additions & 2 deletions my/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ def events(*args, **kwargs) -> List[Event]:
inp = inputs()
# 2.2s for 300 files without cachew
# 0.2s for 300 files with cachew
evit = _get_events(inp, *args, **kwargs)
return list(sorted(evit, key=lambda e: e.cmp_key))
evit = _get_events(inp, *args, **kwargs) # type: ignore[call-arg]
# todo mypy is confused here and thinks it's iterable of Path? perhaps something to do with mcachew?
return list(sorted(evit, key=lambda e: e.cmp_key)) # type: ignore[attr-defined,arg-type]


def stats():
Expand Down
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ setenv = MYPYPATH=doc/example_config
commands =
# TODO ugh. somehow, user installed (editable??) packages leak into this environment??
pip install -e .[testing] .[optional]
pip install git+https://github.com/karlicoss/ghexport
pip install git+https://github.com/karlicoss/hypexport
pip install git+https://github.com/karlicoss/instapexport
pip install git+https://github.com/karlicoss/pockexport
pip install git+https://github.com/karlicoss/rexport
# todo I guess use a script...
python3 -m mypy -p my.hypothesis \
-p my.instapaper \
python3 -m mypy -p my.github.ghexport \
-p my.hypothesis \
-p my.instapaper \
-p my.pocket \
-p my.reddit \
--txt-report .mypy-coverage \
--html-report .mypy-coverage \
{posargs}
Expand Down

0 comments on commit 1c20eb2

Please sign in to comment.