[flake8]
max-line-length = 88
ignore = W503, E203, E704
-extend-exclude = .venv build tests/test_tstring.py
+extend-exclude = .venv build
per-file-ignores =
# Autogenerated section
psycopg/psycopg/errors.py: E125, E128, E302
- uses: actions/setup-python@v6
with:
- python-version: "3.11"
+ python-version: "3.14"
- name: install packages to tests
run: pip install ./psycopg[dev,test]
- uses: actions/setup-python@v6
with:
- python-version: "3.10"
+ python-version: "3.14"
- name: Install the build package
run: pip install build
- uses: actions/setup-python@v6
with:
- python-version: "3.10"
+ python-version: "3.14"
- name: Install the build package
run: pip install build
"wheel >= 0.37",
]
docs = [
- "Sphinx >= 5.0",
- "furo == 2022.6.21",
- "sphinx-autobuild >= 2021.3.14",
- "sphinx-autodoc-typehints >= 1.12",
+ "Sphinx >= 9.1",
+ "furo == 2025.12.19",
+ "sphinx-autobuild >= 2025.8.25",
+ "sphinx-autodoc-typehints >= 3.10.2",
]
[tool.setuptools]
import os
import sys
+import logging
import subprocess as sp
-from distutils import log
from distutils.command.build_ext import build_ext
+log = logging.getLogger(__name__)
+
def get_config(what: str) -> str:
pg_config = "pg_config"
length_sort = true
multi_line_output = 9
sort_order = "psycopg" # requires the isort-psycopg module
-
-[tool.black]
-force_exclude = "tests/test_tstring.py"
wheel == 0.37
# From the 'docs' extra
-Sphinx == 5.0
-furo == 2022.6.21
-sphinx-autobuild == 2021.3.14
-sphinx-autodoc-typehints == 1.12.0
+Sphinx == 9.1.0
+furo == 2025.12.19
+sphinx-autobuild == 2025.8.25
+sphinx-autodoc-typehints == 3.10.2
# Build tools
wheel == 0.37
async def test_connection_no_params(aconn):
with pytest.raises(TypeError):
- await aconn.execute(t"select 1", []) # noqa: F542
+ await aconn.execute(t"select 1", []) # noqa: F542
async def test_cursor_no_params(aconn):
lit = sql.Literal(42)
cur = await aconn.execute(t"select {lit:l} as foo")
assert await cur.fetchone() == (42,)
- assert cur._query.query == b'select 42 as foo'
+ assert cur._query.query == b"select 42 as foo"
with pytest.raises(psycopg.ProgrammingError, match=r"sql\.Literal.*':l'"):
await aconn.execute(t"select {lit} as foo")
@pytest.mark.xfail(reason="Template.join() needed")
async def test_template_join(aconn):
ts = [t"{i} as {name:i}" for i, name in enumerate(("foo", "bar", "baz"))]
- fields = t','.join(ts) # noqa: F542
+ fields = t",".join(ts) # noqa: F542
cur = await aconn.execute(t"select {fields}")
assert await cur.fetchone() == (0, 1, 2)
assert cur.description[0].name == "foo"
async def test_sql_join(aconn):
ts = [t"{i} as {name:i}" for i, name in enumerate(("foo", "bar", "baz"))]
- fields = sql.SQL(',').join(ts)
+ fields = sql.SQL(",").join(ts)
cur = await aconn.execute(t"select {fields:q}")
assert await cur.fetchone() == (0, 1, 2)
assert cur.description[0].name == "foo"
# The version of Python officially used for the conversion.
# Output may differ in other versions.
# Should be consistent with the Python version used in lint.yml
-PYVER = "3.11"
+PYVER = "3.14"
ALL_INPUTS = """
psycopg/psycopg/_conninfo_attempts_async.py
ENTRYPOINT ["tools/async_to_sync.py"]
"""
- cmdline = [engine, "build", "--tag", tag, "-f", "-", str(PROJECT_DIR)]
+ cmdline = [engine, "build", "--network=host", "--tag", tag, "-f", "-"]
+ cmdline += [str(PROJECT_DIR)]
sp.run(cmdline, check=True, text=True, input=containerfile)
cmdline = sys.argv[1:]