From 5c87273895c757fb7b27757900876d74c2d9abf4 Mon Sep 17 00:00:00 2001 From: Cody Fincher <204685+cofin@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:10:54 -0600 Subject: [PATCH] feat(ci): implement `psycopg` client install for `macos` and `windows` runners (#3932) * fix: compat test update * fix: update compat test runners * feat: correctly install windows client --- .github/workflows/ci.yml | 2 +- .github/workflows/test.yml | 11 +++++++++++ pyproject.toml | 3 ++- uv.lock | 21 +++++++++++++-------- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53d0e52c2d..880f08a075 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: os: ["macos-latest", "windows-latest"] uses: ./.github/workflows/test.yml with: - python-version: "3.12" + python-version: "3.13" os: ${{ matrix.os }} timeout: 30 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2fc27f1d7..4dc2e886a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,10 +38,21 @@ jobs: with: python-version: ${{ inputs.python-version }} + # Linux Source - name: Install Build Dependencies run: sudo apt-get install build-essential libpq-dev python3-dev -y if: startsWith(inputs.os, 'ubuntu') + # MacOS Source + - name: Install Build Dependencies + run: brew install libpq && brew link --force libpq + if: startsWith(inputs.os, 'macos') + + # Windows Source + - name: Install Build Dependencies + uses: ikalnytskyi/action-setup-postgres@v7 + if: startsWith(inputs.os, 'windows') + - name: Install uv uses: astral-sh/setup-uv@v5 with: diff --git a/pyproject.toml b/pyproject.toml index 2c838f78f5..130d1d666f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -138,7 +138,8 @@ dev = [ "aiosqlite", "asyncpg>=0.29.0", "psycopg[pool,binary]>=3.1.10,<3.2; python_version < \"3.13\"", - "psycopg[pool,c]; python_version >= \"3.13\"", + "psycopg[pool,c]; python_version >= \"3.13\" and sys_platform == 'linux'", + "psycopg[pool]; python_version >= \"3.13\" and sys_platform != 'linux'", "psycopg2-binary", "psutil>=5.9.8", "hypercorn>=0.16.0", diff --git a/uv.lock b/uv.lock index db82c8796b..d5520e9b45 100644 --- a/uv.lock +++ b/uv.lock @@ -3,7 +3,8 @@ requires-python = ">=3.8, <4.0" resolution-markers = [ "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform != 'win32'", "python_full_version < '3.9' and sys_platform != 'win32'", - "python_full_version >= '3.13' and sys_platform != 'win32'", + "python_full_version >= '3.13' and sys_platform == 'linux'", + "python_full_version >= '3.13' and sys_platform != 'linux' and sys_platform != 'win32'", "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform == 'win32'", "python_full_version < '3.9' and sys_platform == 'win32'", "python_full_version >= '3.13' and sys_platform == 'win32'", @@ -111,7 +112,8 @@ version = "4.8.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform != 'win32'", - "python_full_version >= '3.13' and sys_platform != 'win32'", + "python_full_version >= '3.13' and sys_platform == 'linux'", + "python_full_version >= '3.13' and sys_platform != 'linux' and sys_platform != 'win32'", "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform == 'win32'", "python_full_version >= '3.13' and sys_platform == 'win32'", ] @@ -1903,7 +1905,7 @@ dev = [ { name = "opentelemetry-sdk" }, { name = "psutil" }, { name = "psycopg", extra = ["binary"], marker = "python_full_version < '3.13'" }, - { name = "psycopg", extra = ["c"], marker = "python_full_version >= '3.13'" }, + { name = "psycopg", extra = ["c"], marker = "python_full_version >= '3.13' and sys_platform == 'linux'" }, { name = "psycopg", extra = ["pool"] }, { name = "psycopg2-binary" }, { name = "python-dotenv" }, @@ -2014,8 +2016,9 @@ dev = [ { name = "litestar", extras = ["full"] }, { name = "opentelemetry-sdk" }, { name = "psutil", specifier = ">=5.9.8" }, + { name = "psycopg", extras = ["pool"], marker = "python_full_version >= '3.13' and sys_platform != 'linux'" }, { name = "psycopg", extras = ["pool", "binary"], marker = "python_full_version < '3.13'", specifier = ">=3.1.10,<3.2" }, - { name = "psycopg", extras = ["pool", "c"], marker = "python_full_version >= '3.13'" }, + { name = "psycopg", extras = ["pool", "c"], marker = "python_full_version >= '3.13' and sys_platform == 'linux'" }, { name = "psycopg2-binary" }, { name = "python-dotenv" }, { name = "starlette" }, @@ -2341,7 +2344,8 @@ version = "0.19.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform != 'win32'", - "python_full_version >= '3.13' and sys_platform != 'win32'", + "python_full_version >= '3.13' and sys_platform == 'linux'", + "python_full_version >= '3.13' and sys_platform != 'linux' and sys_platform != 'win32'", "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform == 'win32'", "python_full_version >= '3.13' and sys_platform == 'win32'", ] @@ -2836,7 +2840,7 @@ binary = [ { name = "psycopg-binary", marker = "python_full_version < '3.13' and implementation_name != 'pypy'" }, ] c = [ - { name = "psycopg-c", marker = "python_full_version >= '3.13' and implementation_name != 'pypy'" }, + { name = "psycopg-c", marker = "python_full_version >= '3.13' and implementation_name != 'pypy' and sys_platform == 'linux'" }, ] pool = [ { name = "psycopg-pool" }, @@ -3336,7 +3340,8 @@ version = "0.25.2" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform != 'win32'", - "python_full_version >= '3.13' and sys_platform != 'win32'", + "python_full_version >= '3.13' and sys_platform == 'linux'", + "python_full_version >= '3.13' and sys_platform != 'linux' and sys_platform != 'win32'", "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform == 'win32'", "python_full_version >= '3.13' and sys_platform == 'win32'", ] @@ -4311,7 +4316,7 @@ version = "0.27.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "attrs" }, - { name = "cffi", marker = "implementation_name != 'pypy' and os_name == 'nt'" }, + { name = "cffi", marker = "(python_full_version < '3.13' and implementation_name != 'pypy' and os_name == 'nt') or (implementation_name != 'pypy' and os_name == 'nt' and sys_platform != 'linux')" }, { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "idna" }, { name = "outcome" },