Repository navigation
115 lines (111 loc) · 4.65 KB
/
Copy pathpython-compat.yml
File metadata and controls
115 lines (111 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Python and uv compatibility
on:
push:
branches: ["**"]
paths:
- "pyproject.toml"
- "uv.lock"
- "src/**"
- "install/install.sh"
- "docs/install.sh"
- "scripts/install.sh"
- "tests/test_install_script.py"
- "tests/test_config_loader.py"
- "tests/test_cli_contract.py"
- "tests/test_dx_completion.py"
- "tests/test_tui_developer_trial.py"
- "tests/test_tui_navigation_state.py"
- "tests/test_tui_exit.py"
- "tests/test_tui_resource_lifecycle.py"
- "tests/test_tui_local_latency.py"
- "tests/test_local_model_optimizations.py"
- "tests/test_thinking_session_timing.py"
- "scripts/check_python_compatibility.py"
- ".github/workflows/python-compat.yml"
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
supported:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, python: "3.12", uv: "0.13.0"}
- {os: ubuntu-latest, python: "3.13", uv: "0.13.0"}
- {os: macos-latest, python: "3.13", uv: "0.13.0"}
- {os: windows-latest, python: "3.13", uv: "0.13.0"}
- {os: ubuntu-latest, python: "3.12", uv: "0.8.0"}
- {os: ubuntu-latest, python: "3.13", uv: "0.13.0", current: true}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ${{ matrix.uv }}
python-version: ${{ matrix.python }}
- name: Validate lockfile and install
run: uv sync --locked --python ${{ matrix.python }} --extra dev
- name: Check current allowed dependency releases
if: matrix.current == true
run: uv pip install --upgrade --editable ".[dev]"
- name: Check installed dependencies
run: uv pip check
- name: Runtime contracts in Python development mode
env:
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
run: >-
uv run --locked --no-sync python -X dev -m pytest -p pytest_asyncio.plugin
tests/test_thinking_session_timing.py tests/test_cli_contract.py
tests/test_headless.py tests/test_runtime_builtin.py tests/test_mcp.py
tests/test_config_loader.py tests/test_tools.py
tests/test_core_tool_history.py tests/test_tool_call_repair.py
tests/test_streaming_tool_calls.py
tests/test_release_metadata.py tests/test_version.py tests/test_install_script.py
tests/test_dx_completion.py tests/test_tui_developer_trial.py tests/test_tui_navigation_state.py
tests/test_tui_exit.py tests/test_tui_resource_lifecycle.py
tests/test_tui_local_latency.py tests/test_local_model_optimizations.py -q
--junitxml=python-compat-tests.xml
- name: Report compatibility failures
if: failure()
shell: python {0}
run: |
from pathlib import Path
import xml.etree.ElementTree as ET
results = Path("python-compat-tests.xml")
if results.exists():
for case in ET.parse(results).iter("testcase"):
for failure in [*case.findall("failure"), *case.findall("error")]:
message = f"{case.get('classname')}.{case.get('name')}: {failure.text or failure.get('message', '')}"
if len(message) > 6000:
message = message[:1000] + "\n... traceback truncated ...\n" + message[-4800:]
message = message.replace("%", "%25").replace("\r", "%0D").replace("\n", "%0A")
print(f"::error::{message}")
- name: Build distribution
run: uv build --python ${{ matrix.python }}
# Advisory probes intentionally bypass the package's Python bound. Enable
# full runtime tests only after builds and dependency consistency pass.
candidate-probe:
if: github.event_name == 'workflow_dispatch'
continue-on-error: true
timeout-minutes: 15
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python: ["3.14", "3.15"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: "0.13.0"
- name: Probe candidate dependency builds
run: >-
uv run --no-project --python 3.12 python scripts/check_python_compatibility.py
--python ${{ matrix.python }} --extra dev --output candidate-dependencies.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: python${{ matrix.python }}-dependencies
path: candidate-dependencies.json