]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore: update build tools to use Python 3.14
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 22 Apr 2026 17:35:44 +0000 (19:35 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 22 Apr 2026 18:15:28 +0000 (20:15 +0200)
Close #1262

.flake8
.github/workflows/lint.yml
.github/workflows/packages-pool.yml
.github/workflows/packages-src.yml
psycopg/pyproject.toml
psycopg_c/build_backend/psycopg_build_ext.py
pyproject.toml
tests/constraints.txt
tests/test_tstring.py
tools/async_to_sync.py

diff --git a/.flake8 b/.flake8
index bd0e12c2953b509fcb4e4d613a595a829b6427f7..c8471a14f272ec8bb0c65652787d71e2053e4750 100644 (file)
--- 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
index f0f674ae0351fe7ed1f1d0dd47ca129533fcc34a..bb1e66db414d5033760ea596176bb6857bc77fa9 100644 (file)
@@ -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]
index 6d77cfeff23061ba28425c948dd329c30c30eba9..8ee46b13371beb975fe820706e02f17cca40081f 100644 (file)
@@ -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
index 6d6eb3cb5bd3db921fd74740b55f1e4adfcbf5cb..9218d1683a4f225bd788b346268270b5503e9cc7 100644 (file)
@@ -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
index c548f969b5ec677d051e0c01e5402be82d06f704..6b5ca309dca3203f97153d0bedb7e92fc60fc30b 100644 (file)
@@ -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]
index b4293fe7dba33943f637f2b011a8a36793ae1b38..66a3d5489502379cd76db3432c97dfebb597c5c0 100644 (file)
@@ -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"
index dcf825878bc59d81caa9b50f3cc7f517ba671b83..e393abfa82c7fa7cf8a3e2e00628c42194f73259 100644 (file)
@@ -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"
index d309696ab334be0cb243f0febece9d5e1826fe43..eaa9d9355ed11442b60dc741d4cbc94624bdd832 100644 (file)
@@ -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
index 4a6db299a51fcfc10c18224ac16b23adc0f94af1..d70d7cedfe56e3e9681075e5f3336ec2e15b3e5a 100644 (file)
@@ -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"
index 03cc85b8bee60e2dd014adf8e558de254b761675..7a43cd5e39693349494173389fb1d62ffca3ec25 100755 (executable)
@@ -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:]