Bump mypy from 1.19.0 to 2.3.1 #188
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lowest-direct-dependencies: | |
| name: Test lowest direct dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| - name: Install lowest direct dependencies | |
| run: | | |
| uv venv --python 3.10 .venv-lowest | |
| uv pip install --python .venv-lowest/bin/python --resolution lowest-direct --editable . | |
| uv pip install --python .venv-lowest/bin/python 'pytest>=9.0.3' | |
| - name: Verify runtime dependency floor | |
| run: .venv-lowest/bin/python -I -c "import importlib.util, numpy; from synforecast import _lib; assert numpy.__version__ == '1.23.5'; assert importlib.util.find_spec('scipy') is None" | |
| - name: Run core compatibility tests | |
| run: >- | |
| .venv-lowest/bin/python -m pytest -o addopts='' | |
| tests/test_config_validation.py | |
| tests/test_docs_navigation.py | |
| tests/test_generate_series.py::test_returns_long_format | |
| tests/test_notebook_examples.py | |
| tests/test_mar_native_search.py | |
| tests/test_presets.py | |
| all-tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| pyproject.toml | |
| uv.lock | |
| - name: Setup devenv | |
| run: uv sync --all-extras | |
| - name: Run Rust tests | |
| run: cargo test --manifest-path rust/Cargo.toml | |
| - name: Run Python tests | |
| run: uv run pytest tests/ -v --cov=synforecast | |
| benchmark-smoke: | |
| name: Benchmark smoke run | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| pyproject.toml | |
| uv.lock | |
| - name: Setup devenv | |
| run: uv sync | |
| # The model-free benchmark CLIs must keep running from a clean checkout. | |
| # The augmentation and pretraining benchmarks need the integration-docs | |
| # dependency group, dataset downloads, and model training; run those | |
| # locally with --quick instead. | |
| - name: Smoke-run benchmark CLIs | |
| run: | | |
| uv run python benchmarks/benchmark_performance.py --quick | |
| uv run python benchmarks/benchmark_balanced_pool.py --quick | |
| uv run python benchmarks/benchmark_batch_parallel.py --quick | |
| optional-engines: | |
| name: Optional dataframe engines | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| pyproject.toml | |
| uv.lock | |
| - name: Setup devenv | |
| run: uv sync | |
| # cuDF needs CUDA hardware and stays a documented local-only check. | |
| - name: Install optional engines | |
| run: uv pip install pyarrow "modin[dask]" | |
| - name: Run optional-engine tests | |
| run: uv run --no-sync pytest tests/test_optional_engines.py --no-cov -v | |
| build-wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@0629f00e5704e5295af04df4238c070808aa1e96 # v1 | |
| with: | |
| args: --release --out dist --find-interpreter | |
| manylinux: auto | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: dist/*.whl | |
| build-sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| - name: Build sdist | |
| uses: PyO3/maturin-action@0629f00e5704e5295af04df4238c070808aa1e96 # v1 | |
| with: | |
| command: sdist | |
| args: --out dist | |
| - name: Install and test sdist | |
| run: | | |
| uv venv .venv-sdist | |
| uv pip install --python .venv-sdist/bin/python dist/*.tar.gz | |
| .venv-sdist/bin/python -I -c "import synforecast; from synforecast import _lib; assert synforecast.__version__" | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| ci-complete: | |
| name: CI complete | |
| if: ${{ always() }} | |
| needs: | |
| - lowest-direct-dependencies | |
| - all-tests | |
| - build-wheels | |
| - build-sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify all CI jobs succeeded | |
| env: | |
| LOWEST_RESULT: ${{ needs['lowest-direct-dependencies'].result }} | |
| TESTS_RESULT: ${{ needs['all-tests'].result }} | |
| WHEELS_RESULT: ${{ needs['build-wheels'].result }} | |
| SDIST_RESULT: ${{ needs['build-sdist'].result }} | |
| run: | | |
| printf 'lowest-direct-dependencies: %s\n' "$LOWEST_RESULT" | |
| printf 'all-tests: %s\n' "$TESTS_RESULT" | |
| printf 'build-wheels: %s\n' "$WHEELS_RESULT" | |
| printf 'build-sdist: %s\n' "$SDIST_RESULT" | |
| if [[ "$LOWEST_RESULT" != "success" || | |
| "$TESTS_RESULT" != "success" || | |
| "$WHEELS_RESULT" != "success" || | |
| "$SDIST_RESULT" != "success" ]]; then | |
| echo "::error::One or more required CI jobs did not succeed." | |
| exit 1 | |
| fi |