-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (78 loc) · 3.04 KB
/
Copy pathpython-tests.yml
File metadata and controls
99 lines (78 loc) · 3.04 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
# Runs the Python test suite (tests/python) added in v1.2.
#
# The existing cmake-multi-platform.yml workflow covers the C++ suite; this one
# covers the Python package that wraps it — the export layer, the CLI, and the
# backward-compatibility regression tests.
name: Python tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
# ── Full suite, with every optional dependency installed ────────────────────
test:
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Windows uses the vendored zlib header; macOS uses the system SDK.
- name: Install zlib (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev
- name: Install package with all extras
run: |
python -m pip install --upgrade pip
pip install ".[all]" pytest pytest-cov
- name: Run tests
run: pytest -v --cov=docx_comment_parser --cov-report=term-missing
# ── Minimum supported Python, with NO optional dependencies ────────────────
# Guards two promises at once: the package still imports and works on 3.9,
# and the base install really does need nothing else. Tests that require
# pandas, polars or typer skip themselves via pytest.importorskip.
test-minimal:
name: Python 3.9, zero dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- run: sudo apt-get update && sudo apt-get install -y zlib1g-dev
- name: Install without extras
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest
- name: Confirm nothing extra was pulled in
run: |
! pip show pandas > /dev/null 2>&1
! pip show polars > /dev/null 2>&1
! pip show typer > /dev/null 2>&1
echo "core install is dependency-free"
- name: Run tests
run: pytest -v
# ── Static typing ──────────────────────────────────────────────────────────
typecheck:
name: mypy --strict
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: sudo apt-get update && sudo apt-get install -y zlib1g-dev
- name: Install package and type checker
run: |
python -m pip install --upgrade pip
pip install ".[all]" mypy
- name: Type check
run: mypy