]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
ci: test integration of pool package with previous psycopg version
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 7 May 2025 02:45:14 +0000 (04:45 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 7 May 2025 23:17:11 +0000 (01:17 +0200)
.github/workflows/tests.yml
psycopg_pool/pyproject.toml

index a171e395f68ac98e411543407afc10de4a52897d..ce5f76a1c0498e0b6324ac019246319a0df49e75 100644 (file)
@@ -137,6 +137,48 @@ jobs:
         run: ./tools/ci/ci_test.sh
 
 
+  # }}}
+
+  pool-integration:  # {{{
+    # Test the current pool version with older psycopg versions
+    runs-on: ubuntu-latest
+    if: true
+
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - {psycopg: "3.3", python: "3.13", postgres: "postgres:17"}
+          - {psycopg: "3.2", python: "3.12", postgres: "postgres:17"}
+
+    env:
+      DEPS: psycopg<${{ matrix.psycopg }} ./psycopg_pool[test]
+      PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres password=password"
+      MARKERS: "pool"
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - uses: actions/setup-python@v5
+        with:
+          python-version: ${{ matrix.python }}
+
+      - name: Start PostgreSQL service
+        # Note: this would love to be a service, but I don't see a way to pass
+        # the args to the docker run command line.
+        run: |
+          docker pull ${{ matrix.postgres }}
+          docker run --rm -d --name postgres -p 5432:5432 \
+            -e POSTGRES_PASSWORD=password ${{ matrix.postgres }} \
+            -c max_prepared_transactions=10
+
+      - name: Install Python packages
+        run: pip install $DEPS
+
+      - name: Run tests
+        run: ./tools/ci/ci_test.sh
+
+
   # }}}
 
   macos-14:  # {{{
index 6f94406c4292a0ef004def44ade9d7523b3eb0a4..fd13ed75e02ea07f411c959f25a50e3aa134672e 100644 (file)
@@ -51,6 +51,16 @@ Code = "https://github.com/psycopg/psycopg"
 file = "README.rst"
 content-type = "text/x-rst"
 
+[project.optional-dependencies]
+test = [
+    "anyio >= 4.0",
+    "mypy >= 1.14",
+    "pproxy >= 2.7",
+    "pytest >= 6.2.5",
+    "pytest-cov >= 3.0",
+    "pytest-randomly >= 3.5",
+]
+
 [tool.setuptools]
 zip-safe = false
 include-package-data = true