From 6ce41c5dbfd1481959ff55e2d101a25b4938600f Mon Sep 17 00:00:00 2001 From: Roman Lutz Date: Fri, 27 Feb 2026 15:35:03 -0800 Subject: [PATCH] Add Python 3.14 support - Bump requires-python upper bound from <3.14 to <3.15 - Add Python 3.14 classifier - Add Python 3.14 to CI test matrix - Add python_version < 3.14 marker for gradio (blocked by pydantic-core) - Bump actions/checkout v3->v5, actions/setup-python v3->v6, actions/cache v3->v4 Blockers resolved since PR #1130 was opened: - datasets/PyArrow: supported since PyArrow 22+ - pyodbc: supported since v5.3.0 - spacy: supported since v3.8.10 - torch: supported since PyTorch 2.10 - semantic-kernel: removed from dependencies Remaining blocker (optional extra only): - gradio: blocked by pydantic-core missing 3.14 wheels Relates to #1130 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build_and_test.yml | 14 +++++++------- pyproject.toml | 11 ++++++----- .../unit/executor/benchmark/test_fairness_bias.py | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 3f677f2767..2f07be58a6 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -31,14 +31,14 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v6 with: python-version: ${{ env.PRE_COMMIT_PYTHON_VERSION }} - name: Cache pre-commit environments - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} @@ -80,10 +80,10 @@ jobs: # Main job runs only if pre-commit succeeded main-job: strategy: - fail-fast: true + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: ["3.10", "3.11", "3.12", "3.13"] + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] package_name: ["pyrit"] package_extras: ["dev", "dev_all"] runs-on: ${{ matrix.os }} @@ -94,10 +94,10 @@ jobs: checks: write pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 # Set up Python - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} diff --git a/pyproject.toml b/pyproject.toml index d87582c389..d801c34569 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,9 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.10, <3.14" +requires-python = ">=3.10, <3.15" dependencies = [ "aiofiles>=24,<25", "appdirs>=1.4.0", @@ -117,12 +118,12 @@ playwright = [ "playwright>=1.49.0", ] gradio = [ - "gradio>=5.32.0", + "gradio>=5.32.0; python_version < '3.14'", # https://github.com/gradio-app/gradio/issues/12118 "rpyc>=6.0.1", "pywebview>=5.4" ] fairness_bias = [ - "spacy>=3.8.7", + "spacy>=3.8.7; python_version < '3.14'", # pydantic v1 incompatible with 3.14 ] opencv = [ "opencv-python>=4.11.0.86", @@ -141,14 +142,14 @@ all = [ "flask>=3.1.3", "ipykernel>=6.29.5", "jupyter>=1.1.1", - "gradio>=5.32.0", + "gradio>=5.32.0; python_version < '3.14'", # https://github.com/gradio-app/gradio/issues/12118 "mlflow>=2.22.0", "ml-collections>=1.1.0", "ollama>=0.5.1", "opencv-python>=4.11.0.86", "playwright>=1.49.0", "pywebview>=5.4", - "spacy>=3.8.7", + "spacy>=3.8.7; python_version < '3.14'", # pydantic v1 incompatible with 3.14 "rpyc>=6.0.1", "torch>=2.7.0", "types-PyYAML>=6.0.12.20250516", diff --git a/tests/unit/executor/benchmark/test_fairness_bias.py b/tests/unit/executor/benchmark/test_fairness_bias.py index b33a20da78..36c165b56a 100644 --- a/tests/unit/executor/benchmark/test_fairness_bias.py +++ b/tests/unit/executor/benchmark/test_fairness_bias.py @@ -24,7 +24,7 @@ def is_spacy_installed(): import spacy # noqa: F401 return True - except ModuleNotFoundError: + except Exception: return False