diff --git a/aw_datastore/storages/peewee.py b/aw_datastore/storages/peewee.py index 5110eed..b04ac9c 100644 --- a/aw_datastore/storages/peewee.py +++ b/aw_datastore/storages/peewee.py @@ -13,7 +13,11 @@ from aw_core.dirs import get_data_dir from aw_core.models import Event from playhouse.migrate import SqliteMigrator, migrate -from playhouse.sqlite_ext import SqliteExtDatabase +try: + from playhouse.sqlite_ext import SqliteExtDatabase +except ImportError: + # peewee 4 is missing SqliteExtDatabase + from peewee import SqliteDatabase as SqliteExtDatabase import peewee from peewee import ( diff --git a/pyproject.toml b/pyproject.toml index d6acc51..983a14a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ aw-cli = "aw_cli.__main__:main" [tool.poetry.dependencies] python = "^3.8" jsonschema = "^4.3" -peewee = "3.*" +peewee = ">=3.0.0,<5.0.0" platformdirs = "3.10" # pinned due to sometimes breaking changes in minor versions: https://github.com/ActivityWatch/aw-core/pull/122#issuecomment-1768020335 iso8601 = "*" rfc3339-validator = "^0.1.4" # needed for the date-type format in jsonschema