Skip to content

build(deps): fix building with peewee 4#133

Open
wojnilowicz wants to merge 1 commit intoActivityWatch:masterfrom
wojnilowicz:fix-building-with-peewee-4
Open

build(deps): fix building with peewee 4#133
wojnilowicz wants to merge 1 commit intoActivityWatch:masterfrom
wojnilowicz:fix-building-with-peewee-4

Conversation

@wojnilowicz
Copy link
Copy Markdown

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 19, 2026

Greptile Summary

This PR widens the peewee version pin to allow peewee 4 and adds a try/except fallback for the SqliteExtDatabase import. The version-pin change in pyproject.toml is the meaningful fix, but the code change in peewee.py is based on a false premise: SqliteExtDatabase is still present in playhouse.sqlite_ext in peewee 4, so the ImportError branch is dead code and the comment that accompanies it is inaccurate.

  • P1 — Dead code with misleading comment: The except ImportError branch in peewee.py will never execute under peewee 4 because SqliteExtDatabase was not removed; the comment "peewee 4 is missing SqliteExtDatabase" is factually wrong and should be corrected.
  • P2 — Non-standard constraint syntax: >= 3.*, < 5.0 should be expressed as >=3.0.0,<5.0.0 for unambiguous Poetry semantics.

Confidence Score: 4/5

The pyproject.toml pin change is the functional fix and is correct in intent; the peewee.py change introduces dead code with a misleading comment that should be corrected before merging.

There is one P1 finding: the ImportError fallback is dead code (the class it guards against being missing is not actually missing in peewee 4), and the inaccurate comment will mislead future maintainers. The version constraint syntax is a P2 style issue. These lower confidence from 5 to 4.

aw_datastore/storages/peewee.py — the try/except import block needs re-examination; pyproject.toml — minor syntax cleanup needed.

Important Files Changed

Filename Overview
aw_datastore/storages/peewee.py Adds try/except around the SqliteExtDatabase import with a fallback to peewee.SqliteDatabase, but the comment is factually wrong — peewee 4 still ships SqliteExtDatabase in playhouse.sqlite_ext, so the ImportError branch is dead code and will never execute.
pyproject.toml Widens the peewee version pin from 3.* to >= 3.*, < 5.0 to allow peewee 4; the intent is correct but the wildcard-inside-comparison syntax is non-standard for Poetry — should be >=3.0.0,<5.0.0.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Import peewee] --> B{peewee version}
    B -- "3.x" --> C[playhouse.sqlite_ext.SqliteExtDatabase exists]
    B -- "4.x" --> D[playhouse.sqlite_ext.SqliteExtDatabase\nSTILL exists in peewee 4]
    C --> E[try block succeeds]
    D --> E
    E --> F[SqliteExtDatabase used as-is]
    G[except ImportError] --> H[Fallback: peewee.SqliteDatabase\nas SqliteExtDatabase]
    G -.->|"Never triggered\nwith peewee 3 or 4"| H
Loading

Reviews (1): Last reviewed commit: "build(deps): fix building with peewee 4" | Re-trigger Greptile

Comment thread aw_datastore/storages/peewee.py
Comment thread pyproject.toml Outdated
@wojnilowicz wojnilowicz force-pushed the fix-building-with-peewee-4 branch from 9a6614b to 40508b9 Compare April 19, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant