From 09ef943d0ae01bf6cd0f39aa7e97d98b66690aae Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Thu, 25 Jan 2024 23:20:34 +0100 Subject: [PATCH] Re-add python3.12 and skip airflow test for this version --- .github/workflows/ci.yml | 2 +- tests/airflow/test_operators.py | 4 ++++ tests/conftest.py | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/conftest.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f0b7a9..89a5d1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: fail-fast: true matrix: os: [ "ubuntu-latest", "macos-latest" ] - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] runs-on: ${{ matrix.os }} steps: - name: Check out repository diff --git a/tests/airflow/test_operators.py b/tests/airflow/test_operators.py index 0d7327c..13180f4 100644 --- a/tests/airflow/test_operators.py +++ b/tests/airflow/test_operators.py @@ -2,10 +2,14 @@ from unittest import mock +import pytest from spark_on_k8s.airflow.operators import SparkOnK8SOperator from spark_on_k8s.client import ExecutorInstances, PodResources +from conftest import PYTHON_312 + +@pytest.mark.skipif(PYTHON_312, reason="Python 3.12 is not supported by Airflow") class TestSparkOnK8SOperator: @mock.patch("spark_on_k8s.client.SparkOnK8S.submit_app") def test_execute(self, mock_submit_app): diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..9c44d17 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +import sys + +PYTHON_312 = sys.version_info.major == 3 and sys.version_info.minor == 12