Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@ jobs:
run: pytest tests/test_encoding.py tests/test_utils.py tests/test_config.py -v

database:
name: PostgreSQL ${{ matrix.postgres }} (py${{ matrix.python }})
name: PostgreSQL ${{ matrix.postgres }} (py${{ matrix.python }}${{ matrix.psycopg && format(', psycopg {0}', matrix.psycopg) || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
# Rather than the full cross product, pin the corners: the oldest
# supported pair, the newest pair, and the combination LMFDB actually
# deploys. Add a row here when a new PostgreSQL major is released.
# The extra oldest-pair row pins psycopg to the declared minimum
# (pyproject's pgbinary/pgsource floor), so the floor stays honest.
matrix:
include:
- {python: "3.9", postgres: "13"}
- {python: "3.9", postgres: "13", psycopg: "3.2.4"}
- {python: "3.11", postgres: "15"}
- {python: "3.12", postgres: "16"}
- {python: "3.13", postgres: "17"}
Expand Down Expand Up @@ -121,6 +124,10 @@ jobs:
- name: Install
run: python -m pip install -e ".[pgbinary,test]"

- name: Pin psycopg to the declared minimum
if: matrix.psycopg
run: python -m pip install "psycopg[binary]==${{ matrix.psycopg }}"

- name: Show server version
run: psql -c "SELECT version()"

Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ migration note.
psycopg2, and it re-exports `SQL`, `Identifier`, `Placeholder`, `Literal`,
`Composable` and `Composed` from `psycodict` so callers need not import a
driver directly. *Migration:* install with the `pgbinary` or `pgsource` extra
(`pip install "psycodict[pgbinary]"`), and import the SQL composition classes
(`pip install "psycodict[pgbinary]"`; psycopg 3.2.4 or newer -- the
notification listener relies on psycopg 3.2 APIs and on 3.2.4's
notification-delivery fix), and import the SQL composition classes
from `psycodict` rather than `psycopg2.sql`. (#88)
- **The old `join_search` method is removed.** *Migration:* pass `join=` to
`search` (or `count` / `lucky`) instead; see the joins section of
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds; install psycodict with one of the two extras:

```
pip install "psycodict[pgbinary]" # pulls in psycopg[binary]; no system libpq needed
pip install "psycodict[pgsource]" # pulls in psycopg; builds against your system libpq
pip install "psycodict[pgsource]" # pulls in pure-Python psycopg, which uses your system libpq
```

## Quickstart
Expand Down Expand Up @@ -128,7 +128,7 @@ See the [CHANGELOG](https://github.com/roed314/psycodict/blob/main/CHANGELOG.md)

- Python 3.9 or newer.
- PostgreSQL 13 through 18.
- psycopg 3 (installed through the `pgbinary` or `pgsource` extra above).
- psycopg 3.2.4 or newer (installed through the `pgbinary` or `pgsource` extra above).

## Setting up PostgreSQL

Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ Repository = "https://github.com/roed314/psycodict"
Changelog = "https://github.com/roed314/psycodict/blob/main/CHANGELOG.md"

[project.optional-dependencies]
pgsource = ["psycopg>=3.1"]
pgbinary = ["psycopg[binary]>=3.1"]
# 3.2 introduced Connection.notifies(timeout=..., stop_after=...), which the
# notification listener uses, and 3.2.4 fixed notifications being dropped
# while no generator was consuming them -- essential for the pull-based
# NotificationListener.poll().
pgsource = ["psycopg>=3.2.4"]
pgbinary = ["psycopg[binary]>=3.2.4"]
test = ["pytest>=7"]

[tool.setuptools.dynamic]
Expand Down