Skip to content

Commit 40bada7

Browse files
chore: Add psycopg 2.9.10 into requirements-test.txt (#407)
psycopg 2.9.10 is supported on Python 3.13 for Windows now: psycopg/psycopg2#1736. So we can add psycopg 2.9.10 into requirements-test.txt. This change does the following: - Add psycopg2 into requirement-tests.txt. - Fix the lint issue about enum member annotation: https://mypy.readthedocs.io/en/stable/changelog.html#change-to-enum-membership-semantics. - Move test_psycopg2_direct_connection.py back into tests/system folder because it can now run since psycopg2 is in requirements-test.txt.
1 parent 33de532 commit 40bada7

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

google/cloud/alloydb/connector/enums.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class IPTypes(Enum):
2222
Enum for specifying IP type to connect to AlloyDB with.
2323
"""
2424

25-
PUBLIC: str = "PUBLIC"
26-
PRIVATE: str = "PRIVATE"
27-
PSC: str = "PSC"
25+
PUBLIC = "PUBLIC"
26+
PRIVATE = "PRIVATE"
27+
PSC = "PSC"
2828

2929
@classmethod
3030
def _missing_(cls, value: object) -> None:
@@ -39,8 +39,8 @@ class RefreshStrategy(Enum):
3939
Enum for specifying refresh strategy to connect to AlloyDB with.
4040
"""
4141

42-
LAZY: str = "LAZY"
43-
BACKGROUND: str = "BACKGROUND"
42+
LAZY = "LAZY"
43+
BACKGROUND = "BACKGROUND"
4444

4545
@classmethod
4646
def _missing_(cls, value: object) -> None:

requirements-test.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
asyncpg==0.30.0
22
mock==5.1.0
33
pg8000==1.31.2
4+
5+
# psycopg 2.9.10 isn't supported on Python 3.9 for macos-latest GitHub runner.
6+
# It is supported for macos-12 runner:
7+
# https://github.com/psycopg/psycopg2/issues/1737. But macos-12 runner is
8+
# deprecated: https://github.com/actions/runner-images/issues/10721. So we
9+
# install psycopg 2.9.9 on Python 3.9 for macos-latest runner.
10+
psycopg2-binary==2.9.9; python_version == "3.9" and sys_platform == "darwin"
11+
psycopg2-binary==2.9.10; python_version != "3.9" or sys_platform != "darwin"
12+
413
pytest==8.3.4
514
pytest-asyncio==0.24.0
615
pytest-cov==6.0.0

0 commit comments

Comments
 (0)