diff --git a/.circleci/config.yml b/.circleci/config.yml index 95b0975..165d385 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,9 +8,6 @@ jobs: steps: - checkout - - run: ./demo.py - # TODO need to keep full mycfg.py as example? to dummy run CI - - run: python3 -m pip install --user tox - run: python3 -m tox diff --git a/demo.py b/demo.py index ca6a431..3373e35 100755 --- a/demo.py +++ b/demo.py @@ -50,7 +50,7 @@ pages = my.hypothesis.get_pages() from itertools import islice for page in islice(pages, 0, 8): - print('URL: ' + page.link) + print('URL: ' + page.url) print('Title: ' + page.title) print('{} annotations'.format(len(page.highlights))) print() diff --git a/my/books/kobo.py b/my/books/kobo.py index b21777f..bc94f09 100644 --- a/my/books/kobo.py +++ b/my/books/kobo.py @@ -2,6 +2,8 @@ from typing import Callable, Union, List from mycfg import paths from mycfg.repos.kobuddy.src.kobuddy import * +# hmm, explicit imports make pylint a bit happier.. +from mycfg.repos.kobuddy.src.kobuddy import Highlight, set_databases, get_highlights set_databases(paths.kobuddy.export_dir) diff --git a/my/jawbone/__init__.py b/my/jawbone/__init__.py index 3aa2f9d..1323e18 100755 --- a/my/jawbone/__init__.py +++ b/my/jawbone/__init__.py @@ -226,8 +226,11 @@ def predicate(sleep: SleepEntry): def plot(): + # TODO FIXME melatonin data + melatonin_data = {} + # TODO ?? - sleeps = lfilter(predicate, sleeps) + sleeps = list(filter(predicate, load_sleeps())) sleeps_count = len(sleeps) print(sleeps_count) @@ -236,7 +239,7 @@ def plot(): axarr = fig.subplots(nrows=len(sleeps)) for i, (sleep, axes) in enumerate(zip(sleeps, axarr)): plot_one(sleep, fig, axes, showtext=True) - used = dt.get(sleep.date_, None) + used = melatonin_data.get(sleep.date_, None) sused: str color: str # used = True if used is None else False # TODO? diff --git a/tox.ini b/tox.ini index 8f9a467..94e5117 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,15 @@ commands = # TODO e.g. under CI, rely on installing +[testenv:demo] +# TODO wtf???? +changedir = {toxworkdir}/{envname}/../.. +# TODO not sure?? also reuse installed my. instead on installing in demo.py? +skip_install = true +# TODO need to keep full mycfg.py as example? to dummy run CI +commands = ./demo.py + + # [testenv:mypy] # skip_install = true # commands = @@ -23,8 +32,11 @@ commands = # python -m mypy --check-untyped src/cachew -# [testenv:pylint] -# skip_install = true -# commands = -# pip install -e .[testing] -# python -m pylint -E src/cachew +[testenv:pylint] +# TODO wtf???? +changedir = {toxworkdir}/{envname}/../.. +skip_install = true +commands = + pip install -e .[testing] + # for now ignore import errors until I figure out how to import everything for CI checking.. + python -m pylint -E -d import-error my