From ee20807899ca28f8b2a5b48900ac7faf5dc48004 Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 18:20:04 +0200 Subject: [PATCH 1/7] refactor: rename python_package.yml to test_python_package.yml --- .github/workflows/{python_package.yml => test_python_package.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{python_package.yml => test_python_package.yml} (100%) diff --git a/.github/workflows/python_package.yml b/.github/workflows/test_python_package.yml similarity index 100% rename from .github/workflows/python_package.yml rename to .github/workflows/test_python_package.yml From ea269fa261df6375f35057545387f3344c5e9e78 Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 18:44:09 +0200 Subject: [PATCH 2/7] ci: update name of jobs --- .github/workflows/test_python_package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_python_package.yml b/.github/workflows/test_python_package.yml index d052c21f..08f78a87 100644 --- a/.github/workflows/test_python_package.yml +++ b/.github/workflows/test_python_package.yml @@ -1,5 +1,5 @@ # Installs the Python dependencies, installs Crappy, and checks that it imports -name: Python Package +name: Test Python Package on: # Runs on pull requests targeting the default branch @@ -15,7 +15,7 @@ on: - cron: '0 12 1 * *' jobs: - build: + test-python-package: runs-on: ${{ matrix.os }} strategy: fail-fast: false From 81e9b133afa82f2a7bbc9cfad32b2f8903717dda Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 18:44:40 +0200 Subject: [PATCH 3/7] ci: add comments to the GitHub action code --- .github/workflows/test_python_package.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_python_package.yml b/.github/workflows/test_python_package.yml index 08f78a87..57e6a80c 100644 --- a/.github/workflows/test_python_package.yml +++ b/.github/workflows/test_python_package.yml @@ -2,7 +2,7 @@ name: Test Python Package on: - # Runs on pull requests targeting the default branch + # Runs on pull requests targeting the default branches pull_request: types: [opened, edited, reopened, synchronize] branches: ["master", "develop"] @@ -20,18 +20,24 @@ jobs: strategy: fail-fast: false matrix: + # Run on all the supported Python versions python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + # Run on all the supported platforms os: [ubuntu-latest, windows-latest, macos-latest] steps: + # Checkout the repository - name: Checkout uses: actions/checkout@v4 + # Set up the correct version of Python - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + # Install the build dependencies - name: Install dependencies run: python -m pip install --upgrade pip wheel build setuptools + # Install the crappy Python module - name: Install Crappy run: python -m pip install . - name: Import Crappy From 6d5dcdd29d245fbede41b36f4831e6931dd74c5f Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 18:45:29 +0200 Subject: [PATCH 4/7] ci: update setup-python action from v4 to v5 --- .github/workflows/test_python_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_python_package.yml b/.github/workflows/test_python_package.yml index 57e6a80c..3be4b98d 100644 --- a/.github/workflows/test_python_package.yml +++ b/.github/workflows/test_python_package.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v4 # Set up the correct version of Python - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # Install the build dependencies From fc6642b47734ec34ff77b12b51b852e440b1dfae Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 18:46:56 +0200 Subject: [PATCH 5/7] ci: disable check with Python 3.7 run on macOS, no longer supported --- .github/workflows/test_python_package.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_python_package.yml b/.github/workflows/test_python_package.yml index 3be4b98d..788385bc 100644 --- a/.github/workflows/test_python_package.yml +++ b/.github/workflows/test_python_package.yml @@ -40,5 +40,10 @@ jobs: # Install the crappy Python module - name: Install Crappy run: python -m pip install . + # Check if the module imports as expected + # Cannot run for Python 3.7 on macOS as it is not supported anymore - name: Import Crappy + if: | + contains(fromJSON('["Linux", "Windows"]'), runner.os) || + contains(fromJSON('["3.8", "3.9", "3.10", "3.11", "3.12"]'), matrix.python-version) run: python -c "import crappy; print(crappy.__version__)" From 618d6a78ce80396b0c311d213e533e9bc076ac1d Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 18:59:44 +0200 Subject: [PATCH 6/7] fix: misplaced if condition --- .github/workflows/test_python_package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_python_package.yml b/.github/workflows/test_python_package.yml index 788385bc..bc03f30a 100644 --- a/.github/workflows/test_python_package.yml +++ b/.github/workflows/test_python_package.yml @@ -24,6 +24,10 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # Run on all the supported platforms os: [ubuntu-latest, windows-latest, macos-latest] + # Cannot run for Python 3.7 on macOS as it is no longer supported + if: | + contains(fromJSON('["Linux", "Windows"]'), runner.os) || + contains(fromJSON('["3.8", "3.9", "3.10", "3.11", "3.12"]'), matrix.python-version) steps: # Checkout the repository @@ -41,9 +45,5 @@ jobs: - name: Install Crappy run: python -m pip install . # Check if the module imports as expected - # Cannot run for Python 3.7 on macOS as it is not supported anymore - name: Import Crappy - if: | - contains(fromJSON('["Linux", "Windows"]'), runner.os) || - contains(fromJSON('["3.8", "3.9", "3.10", "3.11", "3.12"]'), matrix.python-version) run: python -c "import crappy; print(crappy.__version__)" From f1a8e3a8e48e4959660e2dfabd83489fd35b1ddc Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Thu, 2 May 2024 19:04:21 +0200 Subject: [PATCH 7/7] fix: replace if check with proper matrix exclusion --- .github/workflows/test_python_package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_python_package.yml b/.github/workflows/test_python_package.yml index bc03f30a..3045b69d 100644 --- a/.github/workflows/test_python_package.yml +++ b/.github/workflows/test_python_package.yml @@ -24,10 +24,10 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # Run on all the supported platforms os: [ubuntu-latest, windows-latest, macos-latest] - # Cannot run for Python 3.7 on macOS as it is no longer supported - if: | - contains(fromJSON('["Linux", "Windows"]'), runner.os) || - contains(fromJSON('["3.8", "3.9", "3.10", "3.11", "3.12"]'), matrix.python-version) + # Cannot run for Python 3.7 on macOS as it is no longer supported + exclude: + - os: macos-latest + python-version: 3.7 steps: # Checkout the repository