psycopg.git / summary / log / commit / refs

commit    eeb99b21099185a84e73ec63a8d99ced53e8cc4e
Author:   Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date:     Wed Apr 22 17:35:44 2026 +0000

    chore: update build tools to use Python 3.14
    
    Close #1262


.flake8 | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/packages-pool.yml | 2 +- .github/workflows/packages-src.yml | 2 +- psycopg/pyproject.toml | 8 ++++---- psycopg_c/build_backend/psycopg_build_ext.py | 4 +++- pyproject.toml | 3 --- tests/constraints.txt | 8 ++++---- tests/test_tstring.py | 8 ++++---- tools/async_to_sync.py | 5 +++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.flake8 b/.flake8 index bd0e12c2..c8471a14 100644 --- a/.flake8 +++ b/.flake8 @@ -6,7 +6,7 @@ [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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f0f674ae..bb1e66db 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: - 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] diff --git a/.github/workflows/packages-pool.yml b/.github/workflows/packages-pool.yml index 6d77cfef..8ee46b13 100644 --- a/.github/workflows/packages-pool.yml +++ b/.github/workflows/packages-pool.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.14" - name: Install the build package run: pip install build diff --git a/.github/workflows/packages-src.yml b/.github/workflows/packages-src.yml index 6d6eb3cb..9218d168 100644 --- a/.github/workflows/packages-src.yml +++ b/.github/workflows/packages-src.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.14" - name: Install the build package run: pip install build diff --git a/psycopg/pyproject.toml b/psycopg/pyproject.toml index c548f969..6b5ca309 100644 --- a/psycopg/pyproject.toml +++ b/psycopg/pyproject.toml @@ -93,10 +93,10 @@ dev = [ "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] diff --git a/psycopg_c/build_backend/psycopg_build_ext.py b/psycopg_c/build_backend/psycopg_build_ext.py index b4293fe7..66a3d548 100644 --- a/psycopg_c/build_backend/psycopg_build_ext.py +++ b/psycopg_c/build_backend/psycopg_build_ext.py @@ -9,10 +9,12 @@ libpq and accounting for other platform differences. 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" diff --git a/pyproject.toml b/pyproject.toml index dcf82587..e393abfa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,3 @@ profile = "black" length_sort = true multi_line_output = 9 sort_order = "psycopg" # requires the isort-psycopg module - -[tool.black] -force_exclude = "tests/test_tstring.py" diff --git a/tests/constraints.txt b/tests/constraints.txt index d309696a..eaa9d935 100644 --- a/tests/constraints.txt +++ b/tests/constraints.txt @@ -24,10 +24,10 @@ types-setuptools == 57.4.0 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 diff --git a/tests/test_tstring.py b/tests/test_tstring.py index 4a6db299..d70d7ced 100644 --- a/tests/test_tstring.py +++ b/tests/test_tstring.py @@ -16,7 +16,7 @@ vint = 16 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): @@ -170,7 +170,7 @@ async def test_sql_literal(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") @@ -185,7 +185,7 @@ async def test_sql_placeholder(aconn): @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" @@ -194,7 +194,7 @@ async def test_template_join(aconn): 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" diff --git a/tools/async_to_sync.py b/tools/async_to_sync.py index 03cc85b8..7a43cd5e 100755 --- a/tools/async_to_sync.py +++ b/tools/async_to_sync.py @@ -27,7 +27,7 @@ import ast_comments as ast # type: ignore # 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 @@ -183,7 +183,8 @@ RUN pip install ./psycopg[dev] 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:] [parent: eaeb5edeb1f0]