Debian Codegraph @

.github/workflows/test.yml

raw
1 name: Run tests
2
3 on:
4 push:
5 branches:
6 - main
7 - '*.x'
8 pull_request:
9 # Run weekly on Monday at 1:23 UTC
10 schedule:
11 - cron: '23 1 * * 1'
12 workflow_dispatch:
13
14
15 jobs:
16 test:
17 runs-on: ${{ matrix.os }}
18 timeout-minutes: 15
19 # Disable scheduled CI runs on forks
20 if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
21 strategy:
22 fail-fast: false
23 matrix:
24 os: [ubuntu-latest, windows-latest]
25 python-version: ["3.12", "3.13", "3.14"]
26 deps: [test_extra]
27 # Test all on ubuntu, test ends on macos
28 include:
29 - os: macos-latest
30 python-version: "3.12"
31 deps: test_extra
32 # free threaded, not with all dependencies
33 - os: ubuntu-latest
34 python-version: "3.14t"
35 deps: test
36 # Tests latest development Python version
37 - os: ubuntu-latest
38 python-version: "3.15-dev"
39 deps: test
40 - os: ubuntu-latest
41 python-version: "3.12"
42 deps: test_extra
43 want-latest-entry-point-code: true
44
45 steps:
46 - uses: actions/checkout@v6
47 - name: Set up Python ${{ matrix.python-version }}
48 uses: actions/setup-python@v6
49 with:
50 python-version: ${{ matrix.python-version }}
51 cache: pip
52 cache-dependency-path: |
53 pyproject.toml
54 - name: Install uv
55 uses: astral-sh/setup-uv@v7
56 - name: Install latex
57 if: runner.os == 'Linux' && matrix.deps == 'test_extra'
58 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
59 - name: Install and update Python dependencies (binary only)
60 if: ${{ ! contains( matrix.python-version, 'dev' ) }}
61 run: |
62 uv pip install --system setuptools wheel build
63 uv pip install --system -e .[${{ matrix.deps }}]
64 uv pip install --system check-manifest pytest-cov pytest
65 - name: Install and update Python dependencies (dev?)
66 if: ${{ contains( matrix.python-version, 'dev' ) }}
67 run: |
68 uv pip install --system --prerelease=allow setuptools wheel build
69 uv pip install --system --prerelease=allow --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -e .[${{ matrix.deps }}]
70 uv pip install --system --prerelease=allow --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple check-manifest pytest-cov
71 - name: Try building with Python build
72 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
73 run: |
74 python -m build
75 shasum -a 256 dist/*
76 - name: Check manifest
77 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
78 run: check-manifest
79
80 - name: Install entry point compatible code (TEMPORARY, April 2024)
81 if: matrix.want-latest-entry-point-code
82 run: |
83 uv pip list --system
84 # Not installing matplotlib's entry point code as building matplotlib from source is complex.
85 # Rely upon matplotlib to test all the latest entry point branches together.
86 uv pip install --system git+https://github.com/ipython/matplotlib-inline.git@main
87 uv pip list --system
88
89 - name: pytest
90 env:
91 COLUMNS: 120
92 run: |
93 pytest --color=yes -raXxs ${{ startsWith(matrix.python-version, 'pypy') && ' ' || '--cov --cov-report=xml' }} --maxfail=15
94 - name: Upload coverage to Codecov
95 uses: codecov/codecov-action@v5
96 with:
97 token: ${{ secrets.CODECOV_TOKEN }}
98 name: Test
99 files: /home/runner/work/ipython/ipython/coverage.xml
100
101 oldest-deps:
102 # pro-actively check backward compatibility
103 runs-on: ${{ matrix.os }}
104 timeout-minutes: 15
105 # Disable scheduled CI runs on forks
106 if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
107 strategy:
108 fail-fast: false
109 matrix:
110 os:
111 - ubuntu-latest
112 # include windows because of platform-specific direct dependencies
113 - windows-latest
114
115 steps:
116 - uses: actions/checkout@v6
117 - name: Set up uv with Python 3.12
118 uses: astral-sh/setup-uv@v7
119 with:
120 python-version: '3.12'
121 enable-cache: true
122 activate-environment: true
123 prune-cache: false
124 cache-dependency-glob: |
125 pyproject.toml
126
127 - name: Install Python dependencies (oldest supported versions)
128 run: uv pip install --resolution=lowest-direct -e .[test]
129
130 - name: Try building with uv build
131 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
132 run: |
133 uv build
134 shasum -a 256 dist/*
135
136 - name: Check manifest
137 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
138 run: uvx check-manifest
139
140 - name: pytest
141 env:
142 COLUMNS: 120
143 run: pytest --color=yes -raXxs