From 4dcfebf308615a87070efc26a1dde150ba4a22e6 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 7 Feb 2025 11:07:51 +0100 Subject: [PATCH 1/8] Test matrix including different os's --- .github/workflows/test.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5628651a6..4e900a4bc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,16 +26,30 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: - - "3.7" - - "3.8" - - "3.9" - - "3.10" - - "3.11" - - "3.12" + os: [ ubuntu-latest, windows-latest, macos-latest ] + python-version: [ "3.12" ] pydantic-version: - pydantic-v1 - pydantic-v2 + include: + - os: ubuntu-22.04 + python-version: "3.7" + pydantic-version: pydantic-v1 + - os: ubuntu-22.04 + python-version: "3.7" + pydantic-version: pydantic-v2 + - os: macos-latest + python-version: "3.8" + pydantic-version: pydantic-v1 + - os: windows-latest + python-version: "3.9" + pydantic-version: pydantic-v2 + - os: ubuntu-latest + python-version: "3.10" + pydantic-version: pydantic-v1 + - os: macos-latest + python-version: "3.11" + pydantic-version: pydantic-v2 fail-fast: false steps: - uses: actions/checkout@v4 From 1097b9a18c073e307b4cbc093942690bde5cac6a Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 7 Feb 2025 11:32:08 +0100 Subject: [PATCH 2/8] Add OS version to coverage file to avoid duplicates --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e900a4bc9..3d69175b01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,6 @@ env: jobs: test: - runs-on: ubuntu-latest strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] @@ -51,6 +50,7 @@ jobs: python-version: "3.11" pydantic-version: pydantic-v2 fail-fast: false + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Python @@ -92,7 +92,7 @@ jobs: - name: Store coverage files uses: actions/upload-artifact@v4 with: - name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }} + name: coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }} path: coverage include-hidden-files: true From 68093d35bf8fadc74e2e5ab8d917c800a46abff2 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 7 Feb 2025 16:42:50 +0100 Subject: [PATCH 3/8] Add a macos test for Python 3.9 --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d69175b01..b4a88d8668 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,9 @@ jobs: - os: windows-latest python-version: "3.9" pydantic-version: pydantic-v2 + - os: macos-latest + python-version: "3.9" + pydantic-version: pydantic-v2 - os: ubuntu-latest python-version: "3.10" pydantic-version: pydantic-v1 From 4d82a5f4e5e3a57ef19a3ec6997356828ad026ac Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 7 Feb 2025 16:59:40 +0100 Subject: [PATCH 4/8] set env to ensure test works well on Windows --- .github/workflows/test.yml | 3 --- tests/test_select_gen.py | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4a88d8668..3d69175b01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,9 +43,6 @@ jobs: - os: windows-latest python-version: "3.9" pydantic-version: pydantic-v2 - - os: macos-latest - python-version: "3.9" - pydantic-version: pydantic-v2 - os: ubuntu-latest python-version: "3.10" pydantic-version: pydantic-v1 diff --git a/tests/test_select_gen.py b/tests/test_select_gen.py index 6d578f7708..8bc949146c 100644 --- a/tests/test_select_gen.py +++ b/tests/test_select_gen.py @@ -1,3 +1,4 @@ +import os import subprocess import sys from pathlib import Path @@ -10,8 +11,8 @@ @needs_py39 def test_select_gen() -> None: result = subprocess.run( - [sys.executable, "scripts/generate_select.py"], - env={"CHECK_JINJA": "1"}, + [sys.executable, Path("scripts") / "generate_select.py"], + env={**os.environ, "CHECK_JINJA": "1"}, check=True, cwd=root_path, capture_output=True, From d2c7f1448650e6828cc2d8b02b00b32f324ab1d2 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 7 Feb 2025 17:35:13 +0100 Subject: [PATCH 5/8] attempt to skip empty files --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e3b70b5abd..7949b626bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,7 @@ exclude_lines = [ 'if __name__ == "__main__":', "if TYPE_CHECKING:", ] +skip_empty = true [tool.coverage.html] show_contexts = true From 881a24235e834894ac61333f19846bd6faf32d8a Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 10 Feb 2025 13:14:08 +0100 Subject: [PATCH 6/8] remove windows testing (for now) to check whether that fixes the coverage issue --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d69175b01..238676fca0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] + os: [ ubuntu-latest, macos-latest ] python-version: [ "3.12" ] pydantic-version: - pydantic-v1 @@ -40,7 +40,7 @@ jobs: - os: macos-latest python-version: "3.8" pydantic-version: pydantic-v1 - - os: windows-latest + - os: ubuntu-latest python-version: "3.9" pydantic-version: pydantic-v2 - os: ubuntu-latest From d80d39cad6e66b2c4ea716f51117f8ca9ab4c8dc Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 10 Feb 2025 14:13:08 +0100 Subject: [PATCH 7/8] reverting further to see when the coverage issue stops popping up --- .github/workflows/test.yml | 40 +++++++++++++++++++------------------- pyproject.toml | 1 - 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 238676fca0..63f780bde4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,30 +25,30 @@ jobs: test: strategy: matrix: - os: [ ubuntu-latest, macos-latest ] + os: ubuntu-latest python-version: [ "3.12" ] pydantic-version: - pydantic-v1 - pydantic-v2 - include: - - os: ubuntu-22.04 - python-version: "3.7" - pydantic-version: pydantic-v1 - - os: ubuntu-22.04 - python-version: "3.7" - pydantic-version: pydantic-v2 - - os: macos-latest - python-version: "3.8" - pydantic-version: pydantic-v1 - - os: ubuntu-latest - python-version: "3.9" - pydantic-version: pydantic-v2 - - os: ubuntu-latest - python-version: "3.10" - pydantic-version: pydantic-v1 - - os: macos-latest - python-version: "3.11" - pydantic-version: pydantic-v2 +# include: +# - os: ubuntu-22.04 +# python-version: "3.7" +# pydantic-version: pydantic-v1 +# - os: ubuntu-22.04 +# python-version: "3.7" +# pydantic-version: pydantic-v2 +# - os: macos-latest +# python-version: "3.8" +# pydantic-version: pydantic-v1 +# - os: ubuntu-latest +# python-version: "3.9" +# pydantic-version: pydantic-v2 +# - os: ubuntu-latest +# python-version: "3.10" +# pydantic-version: pydantic-v1 +# - os: macos-latest +# python-version: "3.11" +# pydantic-version: pydantic-v2 fail-fast: false runs-on: ${{ matrix.os }} steps: diff --git a/pyproject.toml b/pyproject.toml index 7949b626bf..e3b70b5abd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,6 @@ exclude_lines = [ 'if __name__ == "__main__":', "if TYPE_CHECKING:", ] -skip_empty = true [tool.coverage.html] show_contexts = true From 3683de104a682b08e5c3033852825f7e6b18d1c5 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Thu, 20 Feb 2025 09:06:41 +0100 Subject: [PATCH 8/8] push CI --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63f780bde4..63d688fcf1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ env: jobs: test: + runs-on: ubuntu-latest strategy: matrix: os: ubuntu-latest @@ -50,7 +51,7 @@ jobs: # python-version: "3.11" # pydantic-version: pydantic-v2 fail-fast: false - runs-on: ${{ matrix.os }} +# runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Python