-
-
Notifications
You must be signed in to change notification settings - Fork 392
84 lines (77 loc) · 3.02 KB
/
Copy pathpython-app.yml
File metadata and controls
84 lines (77 loc) · 3.02 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
name: Python application
on:
pull_request:
branches: [ "master" ]
paths:
- '.github/workflows/python-app.yml'
- 'pymobiledevice3/**'
- 'tests/**'
- 'pytest.ini'
- 'pyproject.toml'
release:
types: [ created ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}
# Pin uv to the interpreter it provisioned. Without this it prefers an already-installed
# system Python, and macOS runners ship 3.9.6 linked against LibreSSL 2.8.3 -- urllib3 v2
# then emits NotOpenSSLWarning on import, which pytest's `filterwarnings = error` turns
# into a collection failure for the whole 3.9 job.
env:
UV_PYTHON_PREFERENCE: only-managed
strategy:
matrix:
# 3.15 is a prerelease (uv resolves it to the latest beta): it exercises the PEP 810
# lazy-imports path enabled by pymobiledevice3/_lazy_imports.py, which is a no-op below 3.15.
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
# uv provisions the interpreter (python-build-standalone): unlike actions/setup-python,
# it still provides 3.9 on current runner images (ubuntu-24.04, arm64 macOS).
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Run pre-commit hooks
# pyright needs the project's dependencies installed; it runs in the dedicated job below.
env:
SKIP: pyright
run: uvx pre-commit run --all-files
- name: Run device-free tests
run: uv run --extra test pytest -m "not device"
- name: CLI smoke
# The test suite never imports every runtime dependency (e.g. chardet via ASGIWebDAV),
# so a dependency whose wheel crashes on import can pass CI while breaking the CLI —
# exactly what chardet 7.6.0's cp315 wheel did. One bare invocation catches that class.
# No output redirect: pwsh on the Windows runners has no /dev/null.
run: uv run pymobiledevice3 -h
pyright:
if: '! github.event.pull_request.draft'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
run: |
uv venv
uv pip install -e ".[test]"
# Runs the same pre-commit hook contributors get locally (pinned in .pre-commit-config.yaml).
- name: Run pyright
run: uvx pre-commit run pyright --all-files