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
|
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:
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.12", "3.13", "3.14"]
deps: [test_extra]
# Test all on ubuntu, test ends on macos
include:
- os: macos-latest
python-version: "3.12"
deps: test_extra
# free threaded, not with all dependencies
- os: ubuntu-latest
python-version: "3.14t"
deps: test
# Tests latest development Python version
- os: ubuntu-latest
python-version: "3.15-dev"
deps: test
- os: ubuntu-latest
python-version: "3.12"
deps: test_extra
want-latest-entry-point-code: true
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
- name: Install uv
uses: astral-sh/setup-uv@v7
- 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: pytest
env:
COLUMNS: 120
run: |
pytest --color=yes -raXxs ${{ startsWith(matrix.python-version, 'pypy') && ' ' || '--cov --cov-report=xml' }} --maxfail=15
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: Test
files: /home/runner/work/ipython/ipython/coverage.xml
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@v6
- name: Set up uv with Python 3.12
uses: astral-sh/setup-uv@v7
with:
python-version: '3.12'
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: pytest
env:
COLUMNS: 120
run: pytest --color=yes -raXxs
|