From ff247497c7cb2e7a02e8b1a7a0ea3b102a14c8a1 Mon Sep 17 00:00:00 2001 From: rhatgadkar-goog Date: Thu, 24 Oct 2024 22:09:09 +0000 Subject: [PATCH 1/4] feat: add support for Python 3.13 --- .github/workflows/tests.yaml | 4 ++-- noxfile.py | 4 ++-- setup.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8018c4ec..e6649244 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,7 +38,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest, ubuntu-latest] - python-version: ["3.8", "3.12"] + python-version: ["3.8", "3.13"] fail-fast: false steps: - name: Checkout code @@ -99,7 +99,7 @@ jobs: (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') strategy: matrix: - python-version: ["3.8", "3.12"] + python-version: ["3.8", "3.13"] fail-fast: false permissions: contents: read diff --git a/noxfile.py b/noxfile.py index e7c46257..1941a62e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,8 +22,8 @@ ISORT_VERSION = "isort==5.13.2" LINT_PATHS = ["google", "tests", "noxfile.py", "setup.py"] -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"] -UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"] +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] @nox.session diff --git a/setup.py b/setup.py index 0033a3e0..b58a3110 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], platforms="Posix; MacOS X; Windows", packages=packages, From 47621bb4e78909855102c1122d6ebbb46128f25a Mon Sep 17 00:00:00 2001 From: rhatgadkar-goog Date: Wed, 30 Oct 2024 23:39:37 +0000 Subject: [PATCH 2/4] Modify psycopg2 with version 2.9.10 Python 3.13 requires psycopg2 version 2.9.10: https://www.psycopg.org/docs/news.html#what-s-new-in-psycopg-2-9-10 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index baa2e761..d1063cee 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,7 +1,7 @@ asyncpg==0.30.0 mock==5.1.0 pg8000==1.31.2 -psycopg2-binary==2.9.9 +psycopg2-binary==2.9.10 pytest==8.3.3 pytest-asyncio==0.24.0 pytest-cov==5.0.0 From d329c4d7b1f75d024670a9053267371a46bcb501 Mon Sep 17 00:00:00 2001 From: rhatgadkar-goog Date: Wed, 6 Nov 2024 02:31:48 +0000 Subject: [PATCH 3/4] Use macos-12 because only it supports psycopg 2.9.10 --- .github/workflows/tests.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9d4cbc8f..03bd2b74 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,7 +37,10 @@ jobs: pull-requests: write strategy: matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + # TODO: Change to macos-latest when Python 3.9 is depcrecated. We're + # using macos-12 here, because psycopg 2.9.10 package on + # Python 3.9 is only for macos-12. + os: [macos-12, windows-latest, ubuntu-latest] python-version: ["3.9", "3.13"] fail-fast: false steps: From fd0b19e34c8a18fc7ffd1cb96d35fa17f7ae43db Mon Sep 17 00:00:00 2001 From: rhatgadkar-goog Date: Wed, 6 Nov 2024 18:49:44 +0000 Subject: [PATCH 4/4] Move test_psycopg2_direct_connection.py to docs/samples, remove psycopg from requirements-test.txt, revert back to macos-latest --- .github/workflows/tests.yaml | 5 +---- .../samples}/test_psycopg2_direct_connection.py | 0 requirements-test.txt | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) rename {tests/system => docs/samples}/test_psycopg2_direct_connection.py (100%) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 03bd2b74..9d4cbc8f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,10 +37,7 @@ jobs: pull-requests: write strategy: matrix: - # TODO: Change to macos-latest when Python 3.9 is depcrecated. We're - # using macos-12 here, because psycopg 2.9.10 package on - # Python 3.9 is only for macos-12. - os: [macos-12, windows-latest, ubuntu-latest] + os: [macos-latest, windows-latest, ubuntu-latest] python-version: ["3.9", "3.13"] fail-fast: false steps: diff --git a/tests/system/test_psycopg2_direct_connection.py b/docs/samples/test_psycopg2_direct_connection.py similarity index 100% rename from tests/system/test_psycopg2_direct_connection.py rename to docs/samples/test_psycopg2_direct_connection.py diff --git a/requirements-test.txt b/requirements-test.txt index d1063cee..82181c1b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,7 +1,6 @@ asyncpg==0.30.0 mock==5.1.0 pg8000==1.31.2 -psycopg2-binary==2.9.10 pytest==8.3.3 pytest-asyncio==0.24.0 pytest-cov==5.0.0