Repository navigation
169 lines (154 loc) · 6.27 KB
/
Copy pathtest.yml
File metadata and controls
169 lines (154 loc) · 6.27 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Run tests
on:
push:
branches:
- main
- '*.x'
pull_request:
# Run weekly on Monday at 1:23 UTC
schedule:
- cron: '23 1 * * 1'
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
# Disable scheduled CI runs on forks
if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
deps: [test_extra]
# Test all on ubuntu, test ends on macos
include:
- os: macos-latest
python-version: "3.11"
deps: test_extra
# free threaded, not with all dependencies
- os: ubuntu-latest
python-version: "3.14t"
deps: test
# Tests latest development Python version, re-enable once setup-python provides it
# - os: ubuntu-latest
# python-version: "3.16-dev"
# deps: test
- os: ubuntu-latest
python-version: "3.12"
deps: test_extra
want-latest-entry-point-code: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
- name: Install uv
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
- name: Install latex
if: runner.os == 'Linux' && matrix.deps == 'test_extra'
run: echo "disable latex for now, issues in mirros" #sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
- name: Install and update Python dependencies (binary only)
if: ${{ ! contains( matrix.python-version, 'dev' ) }}
run: |
uv pip install --system setuptools wheel build
uv pip install --system -e .[${{ matrix.deps }}]
uv pip install --system check-manifest pytest-cov pytest
- name: Install and update Python dependencies (dev?)
if: ${{ contains( matrix.python-version, 'dev' ) }}
run: |
uv pip install --system --prerelease=allow setuptools wheel build
uv pip install --system --prerelease=allow --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -e .[${{ matrix.deps }}]
uv pip install --system --prerelease=allow --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple check-manifest pytest-cov
- name: Try building with Python build
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
run: |
python -m build
shasum -a 256 dist/*
- name: Check manifest
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
run: check-manifest
- name: Install entry point compatible code (TEMPORARY, April 2024)
if: matrix.want-latest-entry-point-code
run: |
uv pip list --system
# Not installing matplotlib's entry point code as building matplotlib from source is complex.
# Rely upon matplotlib to test all the latest entry point branches together.
uv pip install --system git+https://github.com/ipython/matplotlib-inline.git@main
uv pip list --system
- name: Cache pytest last-failed
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .pytest_cache/v/cache/lastfailed
key: pytest-lastfailed-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.deps }}-${{ github.run_id }}
restore-keys: |
pytest-lastfailed-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.deps }}-
- name: pytest
env:
COLUMNS: 120
run: |
pytest --color=yes -raXxs ${{ startsWith(matrix.python-version, 'pypy') && ' ' || '--cov --cov-report=xml' }} --ff --maxfail=5
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: Test
files: /home/runner/work/ipython/ipython/coverage.xml
# Both flags are attached to the same report; each flag's
# `paths` filter in codecov.yml carves out its bucket.
flags: library,unit-tests
oldest-deps:
# pro-actively check backward compatibility
runs-on: ${{ matrix.os }}
timeout-minutes: 15
# Disable scheduled CI runs on forks
if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# include windows because of platform-specific direct dependencies
- windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Set up uv with Python 3.11
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
python-version: '3.11'
enable-cache: true
activate-environment: true
prune-cache: false
cache-dependency-glob: |
pyproject.toml
- name: Install Python dependencies (oldest supported versions)
run: uv pip install --resolution=lowest-direct -e .[test]
- name: Try building with uv build
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
run: |
uv build
shasum -a 256 dist/*
- name: Check manifest
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
run: uvx check-manifest
- name: Cache pytest last-failed
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .pytest_cache/v/cache/lastfailed
key: pytest-lastfailed-oldest-deps-${{ matrix.os }}-${{ github.run_id }}
restore-keys: |
pytest-lastfailed-oldest-deps-${{ matrix.os }}-
- name: pytest
env:
COLUMNS: 120
run: pytest --color=yes -raXxs --ff --maxfail=5