Skip to content

ENH correctly restore default_factory of a defaultdict #1861

ENH correctly restore default_factory of a defaultdict

ENH correctly restore default_factory of a defaultdict #1861

Workflow file for this run

name: pytest
on:
- push
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ${{ matrix.os }}
if: "github.repository == 'skops-dev/skops'"
strategy:
fail-fast: false # need to see which ones fail
matrix:
os: [ubuntu-latest, windows-latest, macos-12]
python: ["3.9", "3.10", "3.11", "3.12"]
# this is to make the CI run on different sklearn versions
include:
- python: "3.9"
sklearn_version: "1.1"
numpy_version: "numpy<2"
- python: "3.10"
sklearn_version: "1.2"
numpy_version: "numpy"
- python: "3.11"
sklearn_version: "1.4"
numpy_version: "numpy"
- python: "3.12"
sklearn_version: "nightly"
numpy_version: "numpy"
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 15
steps:
# The following two steps are workarounds to retrieve the "real" commit
# message and make it available in later steps. This is because we want to
# check the content of the commit message, but on PRs, it's replaced by an
# artificial commit message. See https://github.com/skops-dev/skops/pull/147
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.after}}
- run: |
echo PR_COMMIT_MESSAGE=$(git log -1 --pretty=format:\"%s\") >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install -U pip
pip install "pytest<8"
pip install "${{ matrix.numpy_version }}"
if [ ${{ matrix.sklearn_version }} == "nightly" ];
then pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scikit-learn;
else pip install "scikit-learn~=${{ matrix.sklearn_version }}";
fi
pip install .[docs,tests]
pip install black=="23.9.1" ruff=="0.0.292" mypy=="1.6.0"
if [ ${{ matrix.os }} == "ubuntu-latest" ];
then sudo apt install pandoc && pandoc --version;
fi
python --version
pip --version
pip list
shell: bash
- name: Check black
run: black --check --diff .
- name: Check ruff
run: ruff check --diff .
- name: Tests
env:
SUPER_SECRET: ${{ secrets.HF_HUB_TOKEN }}
PYTHONIOENCODING: "utf-8"
run: |
python -m pytest -s -v --cov-report=xml -m "not inference" skops/
- name: Mypy
run: mypy --config-file pyproject.toml skops
- name: Inference tests (conditional)
if: contains(env.PR_COMMIT_MESSAGE, '[CI inference]')
run: |
python -m pytest -s -v -m "inference" skops/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true
# the coverage is uploaded with or without a token. This only helps with some
# codecov errors. It's a recommended action from here:
# https://github.com/codecov/codecov-action/issues/837#issuecomment-1453877750
token: 2b8d4d69-6de6-4e1d-840a-5ccf9d849565