Skip to content

Commit

Permalink
Merge branch 'main' into FIX-multiple-instance-persistance
Browse files Browse the repository at this point in the history
  • Loading branch information
E-Aho authored Nov 10, 2022
2 parents df3848a + 53fa83b commit aeb5b12
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,20 @@ jobs:
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@v3
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@v3
with:
Expand Down Expand Up @@ -63,11 +76,16 @@ jobs:
env:
SUPER_SECRET: ${{ secrets.HF_HUB_TOKEN }}
run: |
python -m pytest -s -v --cov-report=xml skops/
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:
Expand Down
7 changes: 6 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ internet with:

.. code:: bash
pytest -m "not network"
pytest -m "not network" skops
Similarly, there is a flag, ``-m inference`` for tests that hit the Hugging Face
Inference API, which can be quite slow or even hang. Skip these tests as long as
you don't make any changes to this functionality. If you already skip network
tests, the inference tests will also be skipped.


Releases
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ filterwarnings = [
]
markers = [
"network: marks tests as requiring internet (deselect with '-m \"not network\"')",
"inference: marks tests that call inference API (deselect with '-m \"not inference\"')",
]
addopts = "--cov=skops --cov-report=term-missing --doctest-modules"

Expand Down
4 changes: 3 additions & 1 deletion skops/hub_utils/tests/test_hf_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def repo_path_for_inference():


@pytest.mark.network
@pytest.mark.inference
@pytest.mark.skipif(
IS_SKLEARN_DEV_BUILD, reason="Inference tests cannot run with sklearn dev build"
)
Expand All @@ -414,7 +415,8 @@ def test_inference(
repo_path_for_inference,
destination_path,
):
# test inference backend for classifier and regressor models.
# test inference backend for classifier and regressor models. This test can
# take a lot of time and be flaky.
client = HfApi()

repo_path = repo_path_for_inference
Expand Down

0 comments on commit aeb5b12

Please sign in to comment.