Compare commits

..

2 commits

Author SHA1 Message Date
9e2fb188ab
Update woodpecker
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-01-18 19:12:16 +01:00
d958956f8d
Add woodpecker ci file
Added basic continuous integration tests to run on any push.
2022-01-18 18:37:23 +01:00
3 changed files with 4 additions and 7 deletions

View file

@ -1,4 +1,4 @@
import nox # type: ignore import nox
@nox.session(python=["3.7", "3.8", "3.9"]) @nox.session(python=["3.7", "3.8", "3.9"])

View file

@ -4,6 +4,6 @@ import sys
try: try:
from importlib.metadata import version as metadata_version from importlib.metadata import version as metadata_version
except ImportError: except ImportError:
from importlib_metadata import version as metadata_version # type: ignore from importlib_metadata import version as metadata_version
__version__ = str(metadata_version(__name__)) __version__ = str(metadata_version(__name__))

View file

@ -55,10 +55,9 @@ def habit_list_add_ids(c: sqlite3.Cursor, habitlist: list[Habit]) -> dict[int, H
:return habit_id_dict: The habit collection as a dict with the keys :return habit_id_dict: The habit collection as a dict with the keys
consisting of the habit's sqlite database ID. consisting of the habit's sqlite database ID.
""" """
with_id: dict[int, Habit] = {} with_id = {}
for h in habitlist: for h in habitlist:
sql_id = fetch_habit_id(c, h.uuid or "") sql_id = fetch_habit_id(c, h.uuid or "")
if sql_id is not None:
with_id[sql_id] = h with_id[sql_id] = h
return with_id return with_id
@ -75,8 +74,6 @@ def fetch_habit_id(cursor: sqlite3.Cursor, uuid: str) -> Optional[int]:
if id is not None: if id is not None:
return id[0] return id[0]
return None
def add_to_database( def add_to_database(
cursor: sqlite3.Cursor, habits: dict[int, Habit], repetition: Repetition cursor: sqlite3.Cursor, habits: dict[int, Habit], repetition: Repetition