various CI updates

This commit is contained in:
Dima Gerasimov 2020-01-24 10:37:42 +00:00 committed by Dmitrii Gerasimov
parent 7d56d85731
commit 6787c9c0d6
5 changed files with 25 additions and 11 deletions

View file

@ -8,9 +8,6 @@ jobs:
steps: steps:
- checkout - 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 pip install --user tox
- run: python3 -m tox - run: python3 -m tox

View file

@ -50,7 +50,7 @@ pages = my.hypothesis.get_pages()
from itertools import islice from itertools import islice
for page in islice(pages, 0, 8): for page in islice(pages, 0, 8):
print('URL: ' + page.link) print('URL: ' + page.url)
print('Title: ' + page.title) print('Title: ' + page.title)
print('{} annotations'.format(len(page.highlights))) print('{} annotations'.format(len(page.highlights)))
print() print()

View file

@ -2,6 +2,8 @@ from typing import Callable, Union, List
from mycfg import paths from mycfg import paths
from mycfg.repos.kobuddy.src.kobuddy import * 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) set_databases(paths.kobuddy.export_dir)

View file

@ -226,8 +226,11 @@ def predicate(sleep: SleepEntry):
def plot(): def plot():
# TODO FIXME melatonin data
melatonin_data = {}
# TODO ?? # TODO ??
sleeps = lfilter(predicate, sleeps) sleeps = list(filter(predicate, load_sleeps()))
sleeps_count = len(sleeps) sleeps_count = len(sleeps)
print(sleeps_count) print(sleeps_count)
@ -236,7 +239,7 @@ def plot():
axarr = fig.subplots(nrows=len(sleeps)) axarr = fig.subplots(nrows=len(sleeps))
for i, (sleep, axes) in enumerate(zip(sleeps, axarr)): for i, (sleep, axes) in enumerate(zip(sleeps, axarr)):
plot_one(sleep, fig, axes, showtext=True) plot_one(sleep, fig, axes, showtext=True)
used = dt.get(sleep.date_, None) used = melatonin_data.get(sleep.date_, None)
sused: str sused: str
color: str color: str
# used = True if used is None else False # TODO? # used = True if used is None else False # TODO?

22
tox.ini
View file

@ -16,6 +16,15 @@ commands =
# TODO e.g. under CI, rely on installing # 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] # [testenv:mypy]
# skip_install = true # skip_install = true
# commands = # commands =
@ -23,8 +32,11 @@ commands =
# python -m mypy --check-untyped src/cachew # python -m mypy --check-untyped src/cachew
# [testenv:pylint] [testenv:pylint]
# skip_install = true # TODO wtf????
# commands = changedir = {toxworkdir}/{envname}/../..
# pip install -e .[testing] skip_install = true
# python -m pylint -E src/cachew 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