my.instapaper: add stat; add mypy checks on CI

This commit is contained in:
Dima Gerasimov 2020-09-29 19:18:10 +01:00 committed by karlicoss
parent 3404b3fcf1
commit dc642b5a6d
3 changed files with 17 additions and 4 deletions

View file

@ -2,8 +2,12 @@
Feel free to remove this if you don't need it/add your own custom settings and use them Feel free to remove this if you don't need it/add your own custom settings and use them
""" """
from my.core import Paths
class hypothesis: class hypothesis:
from my.core import Paths
# expects outputs from https://github.com/karlicoss/hypexport # expects outputs from https://github.com/karlicoss/hypexport
# (it's just the standard Hypothes.is export format) # (it's just the standard Hypothes.is export format)
export_path: Paths = '/path/to/hypothesis/data' export_path: Paths = '/path/to/hypothesis/data'
class instapaper:
export_path: Paths = ''

View file

@ -6,9 +6,8 @@ REQUIRES = [
] ]
from dataclasses import dataclass from dataclasses import dataclass
from typing import Optional
from .core import Paths, PathIsh from .core import Paths
from my.config import instapaper as user_config from my.config import instapaper as user_config
@ -54,6 +53,12 @@ def pages() -> Iterable[Page]:
return _dal().pages() return _dal().pages()
def stats():
from .core import stat
return stat(pages)
### misc
# TODO dunno, move this to private? # TODO dunno, move this to private?
def is_todo(hl: Highlight) -> bool: def is_todo(hl: Highlight) -> bool:
note = hl.note or '' note = hl.note or ''

View file

@ -32,7 +32,11 @@ commands =
# TODO ugh. somehow, user installed (editable??) packages leak into this environment?? # TODO ugh. somehow, user installed (editable??) packages leak into this environment??
pip install -e .[testing] .[optional] pip install -e .[testing] .[optional]
pip install git+https://github.com/karlicoss/hypexport pip install git+https://github.com/karlicoss/hypexport
python3 -m mypy -p my.hypothesis {posargs} pip install git+https://github.com/karlicoss/instapexport
# todo I guess use a script...
python3 -m mypy -p my.hypothesis \
-p my.instapaper \
{posargs}
# ideally, keep core modules only here # ideally, keep core modules only here