Conversation
…kaging) Brings the Python driver to feature-parity with the Go client and adds a thorough integration test suite. API: - pgque.connect(dsn) factory + Client.close() lifecycle - PgqueClient as context manager - Wrapped error hierarchy: PgqueError + Connection/QueueNotFound/BatchNotFound - Event dataclass for client.send convenience - Message.payload typed as Any (psycopg auto-decodes jsonb) - Send/SendBatch handle dict/list/None/Event payloads consistently Tests: - 30+ tests across send, receive, ack, nack, consumer, concurrency, connect - Per-test unique queue + consumer names; auto teardown via fixture - Env-gated via PGQUE_TEST_DSN; pytest.skip when absent Packaging: - Bump version 0.1.0 -> 0.2.0 (matches SQL release) - Add LICENSE, README.md (install + quickstart + test instructions) - Project URLs, classifiers, authors metadata Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sed pytest-asyncio PEP 639: "License :: OSI Approved :: Apache Software License" classifier conflicts with the SPDX "license = \"Apache-2.0\"" expression. setuptools 68+ rejects this combination — was failing client-smoke CI. Also remove pytest-asyncio from dev deps; the driver is sync (psycopg3) and no test uses asyncio. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
REV ReviewCI: Functional evidence: Verdict: READY FOR USER REVIEW (post-polish) Blocking
Non-blocking
Potential
Anti-leak: ✅ no GitLab/AR/sahmed mentions in the diff. REV review (security, bugs, tests, guidelines, docs). SOC2 items skipped per project policy. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
REV Review (Round 2)CI: All green ( Round 1 findings status:
Verdict: READY FOR USER REVIEW BlockingNone. Non-blocking
Potential
Anti-leak: clean (no GitLab/AR/sahmed/WI/R8 mentions in diff, commits, or PR body). Functional evidence: SQL fully parameterized ( Counts: 5 commits since round 1; ~32 added test functions across 8 test files. REV review (security, bug hunter, test analyzer, guidelines, docs). SOC2 items skipped per project policy. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brings the Python driver to feature-parity with the Go client and adds a thorough integration test suite.
Audit (Go ↔ Python)
connect(dsn)factoryConnectpgque.connectClose()/ context managerclose()+withSendEventsupportSendBatchReceiveAckNackfmt.ErrorfPgqueErrortreeEvent/MessagetypesMessageBug list
Message.payload: strjsonbtodict/list; type was wrongpayload: Anyconnect()factorypsycopg.OperationalErrorPgqueConnectionErrorversion = 0.1.00.2.0LICENSE/README.mdSendrejectedlistpayloadsdictwas JSON-encodeddictandlist(Note for the parent agent: while reading the SQL, I noticed
clients/go/pgque.goNack()buildsROW($2..$12)— 11 fields — butpgque.messageis 10 fields and only 10 args are passed. Likely a runtime error in the Go path; outside this PR's scope.)Per-fix breakdown
pgque/__init__.py— re-exportconnect,Event, error classes; add__version__.pgque/client.py— addconnect()factory,close(), context-manager protocol, error wrapping,Eventunpacking insend,listhandling.pgque/types.py—Message.payload: Any; newEventdataclass.pgque/errors.py— new module withPgqueError+PgqueConnectionError/PgqueQueueNotFound/PgqueBatchNotFound/PgqueConsumerNotFound.pgque/consumer.py— unchanged in this PR (already solid; gets new tests).pyproject.toml— bump to0.2.0, addreadme,authors,keywords,classifiers,[project.urls], package-find config.LICENSE— Apache-2.0 (copied from repo root).README.md— install + 30-line quickstart + test instructions.Tests
8 test files, ~30 tests. All env-gated via
PGQUE_TEST_DSN; skipped when unset. Per-test unique queue + consumer names (random suffix), auto-teardown fixture.test_connect.pytest_send.pyEventobject, str/None payloads, unicode, large payload, batch ordering, missing-queue errortest_receive.pytest_nack.pytest_consumer.py*default handler, handler error → nack,stop()returns promptlytest_concurrency.pytest_smoke.pyRun locally
Test plan
python3 -m py_compilepasses on every file inpgque/andtests/pip install -e .[dev] && pytest clients/python/testspasses against PG14–18 (CI)EventAPI choice before merge🤖 Generated with Claude Code