Skip to content

refactor(remote): move build_patches into a psycopg-free module - #20

Merged
philtief merged 1 commit into
mainfrom
refactor/pure-proposals
Sep 29, 2026
Merged

philtief merged 1 commit into
mainfrom
refactor/pure-proposals

Conversation

@philtief

Copy link
Copy Markdown
Owner

Why

The upcoming local curator (wikibricks-curator) must turn model proposals into curation patches with the existing, tested build_patches. build_patches uses no database, but its module imports psycopg at the top, so it can't be imported where PostgreSQL isn't installed.

Change

  • build_patches, _page_proposal, the proposal-field constants and _canonical_json move unchanged to wikibricks_remote/proposals.py. The module imports no psycopg, databricks or PostgreSQL store.
  • wikibricks_remote.maintenance imports them from there, so from wikibricks_remote.maintenance import build_patches still works.
  • The import-boundary test now also imports wikibricks_remote.proposals and wikibricks_remote.resources with PostgreSQL and Databricks blocked.

Verification

  • The boundary test failed before the move and passes after.
  • The removed and added lines match exactly, apart from the import lines.
  • 206 tests pass, and Ruff is clean. There's no behaviour change and no CHANGELOG entry.

GLM 5.3 Flash made the move; I confirmed in review that it's a pure move.

This pull request and its description were written by Isaac.

`build_patches` uses no database, but its module imported psycopg, so a
local curator could not reuse it. Move it and its helpers unchanged to
`wikibricks_remote.proposals`; `maintenance` re-imports it. The import
boundary test now covers `proposals` and `resources`.

Moved by GLM 5.3 Flash; verified as a pure move in review.

Co-authored-by: Isaac <no-reply@databricks.com>
@philtief
philtief merged commit 109624b into main Sep 29, 2026
3 checks passed
@philtief
philtief deleted the refactor/pure-proposals branch September 29, 2026 07:24
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