From 63436475a11acdc43474d423a4994ebf21b11b03 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:13:49 +0100 Subject: [PATCH 01/12] fix test to be ready for Windows --- tests/test_select_gen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 f9465b294b6b2903011fba61326e5bd018863320 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:20:55 +0100 Subject: [PATCH 02/12] put os into the matrix --- .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 9126db93c5..add3c3bf26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,9 +23,9 @@ env: jobs: test: - runs-on: ubuntu-latest strategy: matrix: + os: [ ubuntu-latest ] python-version: - "3.8" - "3.9" @@ -36,6 +36,7 @@ jobs: - pydantic-v1 - pydantic-v2 fail-fast: false + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Python From adca0b0836e1d352809c4c0fe78ea0a9f94e99ae Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:27:45 +0100 Subject: [PATCH 03/12] test with 3 os's --- .github/workflows/test.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index add3c3bf26..a7c8393d45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,13 +25,8 @@ jobs: test: strategy: matrix: - os: [ ubuntu-latest ] - python-version: - - "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 From 94d8cf33f23bedbadeb2b301b4fefc53d222380d Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:30:49 +0100 Subject: [PATCH 04/12] Add OS version to coverage file name to avoid duplicates --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7c8393d45..812bb835dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,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 86ab16517a543e7bac8a0693235b7c2de8f5d68c Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:34:36 +0100 Subject: [PATCH 05/12] only test on ubuntu --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 812bb835dd..e5df2944dd 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 ] python-version: [ "3.12" ] pydantic-version: - pydantic-v1 From 68ee41f95b89a3c522239a789d9ee825c237097c Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:39:52 +0100 Subject: [PATCH 06/12] also test on macos-latest --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5df2944dd..34fe3ecb91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-latest, macos-latest ] python-version: [ "3.12" ] pydantic-version: - pydantic-v1 From b75acf9f97c87a219ce1a3af4cd92a09078fe5b3 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:44:27 +0100 Subject: [PATCH 07/12] only test on macos-latest --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34fe3ecb91..e33e055dcc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ macos-latest ] python-version: [ "3.12" ] pydantic-version: - pydantic-v1 From e67f194ebf7a8084c07995fa0f13bcac7950467d Mon Sep 17 00:00:00 2001 From: svlandeg Date: Fri, 21 Feb 2025 16:48:40 +0100 Subject: [PATCH 08/12] user runner.os instead --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e33e055dcc..82ea3da9e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,7 @@ jobs: - name: Store coverage files uses: actions/upload-artifact@v4 with: - name: coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }} + name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }} path: coverage include-hidden-files: true From 329a737161ed43a709eb99859e44b55862bebedc Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 28 Apr 2025 12:11:01 +0200 Subject: [PATCH 09/12] try on windows only --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cff53c5288..3181f8af10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - os: [ macos-latest ] + os: [ windows-latest ] python-version: - "3.8" - "3.9" From 2e173ea239dc3dc3581ffa2f1eb13ecb6bb9bea9 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 28 Apr 2025 12:20:13 +0200 Subject: [PATCH 10/12] set relative_files setting to True --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 766b055819..4ae195ac73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,6 +81,7 @@ source = [ ] context = '${CONTEXT}' dynamic_context = "test_function" +relative_files = true [tool.coverage.report] show_missing = true From bcbc13e52201c4fa1ac3e3c722329ba255069063 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 28 Apr 2025 12:26:06 +0200 Subject: [PATCH 11/12] test on all 3 OS's --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3181f8af10..3615dea9fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - os: [ windows-latest ] + os: [ ubuntu-latest, windows-latest, macos-latest ] python-version: - "3.8" - "3.9" From e630ce1d275498ba888eb9652dde2d9227e55f47 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 28 Apr 2025 12:35:54 +0200 Subject: [PATCH 12/12] avoid exponential explosion of test configurations --- .github/workflows/test.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3615dea9fb..a66d81755e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,16 +26,29 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] - python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" + python-version: [ "3.13" ] pydantic-version: - pydantic-v1 - pydantic-v2 + include: + - 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 + - os: windows-latest + python-version: "3.12" + pydantic-version: pydantic-v1 + - os: ubuntu-latest + python-version: "3.12" + pydantic-version: pydantic-v2 fail-fast: false runs-on: ${{ matrix.os }} steps: