Skip to content

Commit

Permalink
chore: Add psycopg 2.9.10 into requirements-test.txt (#407)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rhatgadkar-goog authored Jan 8, 2025
1 parent 33de532 commit 40bada7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 5 additions & 5 deletions google/cloud/alloydb/connector/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class IPTypes(Enum):
Enum for specifying IP type to connect to AlloyDB with.
"""

PUBLIC: str = "PUBLIC"
PRIVATE: str = "PRIVATE"
PSC: str = "PSC"
PUBLIC = "PUBLIC"
PRIVATE = "PRIVATE"
PSC = "PSC"

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

LAZY: str = "LAZY"
BACKGROUND: str = "BACKGROUND"
LAZY = "LAZY"
BACKGROUND = "BACKGROUND"

@classmethod
def _missing_(cls, value: object) -> None:
Expand Down
9 changes: 9 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
asyncpg==0.30.0
mock==5.1.0
pg8000==1.31.2

# psycopg 2.9.10 isn't supported on Python 3.9 for macos-latest GitHub runner.
# It is supported for macos-12 runner:
# https://github.com/psycopg/psycopg2/issues/1737. But macos-12 runner is
# deprecated: https://github.com/actions/runner-images/issues/10721. So we
# install psycopg 2.9.9 on Python 3.9 for macos-latest runner.
psycopg2-binary==2.9.9; python_version == "3.9" and sys_platform == "darwin"
psycopg2-binary==2.9.10; python_version != "3.9" or sys_platform != "darwin"

pytest==8.3.4
pytest-asyncio==0.24.0
pytest-cov==6.0.0
Expand Down

0 comments on commit 40bada7

Please sign in to comment.