From: Daniele Varrazzo Date: Wed, 22 Apr 2026 17:35:44 +0000 (+0200) Subject: chore: update build tools to use Python 3.14 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=eeb99b21099185a84e73ec63a8d99ced53e8cc4e;p=thirdparty%2Fpsycopg.git chore: update build tools to use Python 3.14 Close #1262 --- diff --git a/.flake8 b/.flake8 index bd0e12c29..c8471a14f 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 f0f674ae0..bb1e66db4 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 6d77cfeff..8ee46b133 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 6d6eb3cb5..9218d1683 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 c548f969b..6b5ca309d 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 b4293fe7d..66a3d5489 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 dcf825878..e393abfa8 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 d309696ab..eaa9d9355 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 4a6db299a..d70d7cedf 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 03cc85b8b..7a43cd5e3 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:]