Skip to content

Commit 611f332

Browse files
committed
Fast failing
1 parent 7df1a83 commit 611f332

2 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/build-python.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ on:
1010
workflow_dispatch:
1111
inputs:
1212
run-integration-tests:
13-
description: 'If integration test should be run'
13+
description: "If integration test should be run"
1414
required: true
1515
type: boolean
1616
default: false
1717
use-cache:
18-
description: 'If cache should be used'
18+
description: "If cache should be used"
1919
required: true
2020
type: boolean
2121
default: true
2222
is-dispatch:
23-
description: 'Just to identify manual dispatch'
23+
description: "Just to identify manual dispatch"
2424
required: true
2525
type: boolean
2626
default: true
2727
workflow_call:
2828
inputs:
2929
run-integration-tests:
30-
description: 'If integration test should be run'
30+
description: "If integration test should be run"
3131
required: true
3232
type: boolean
3333
default: false
3434
use-cache:
35-
description: 'If cache should be used'
35+
description: "If cache should be used"
3636
required: true
3737
type: boolean
3838
default: false
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false # Do not stop when any job fails
5555
matrix:
56-
python-version: [ "3.9", "3.10", "3.11" ]
56+
python-version: ["3.9", "3.10", "3.11"]
5757
os: [ubuntu-latest]
5858
pydantic_v1: [false]
5959
pandas_v1: [false]
@@ -116,8 +116,6 @@ jobs:
116116
pdm install -G :all
117117
pdm list
118118
119-
- name: Lint code
120-
run: pdm run lint
121119
- name: Re-install lightgbm from sources for MacOS
122120
if: ${{ matrix.os == 'macos-latest' }}
123121
run: |
@@ -157,6 +155,12 @@ jobs:
157155
pdm run pip freeze | grep '^pandas'
158156
pdm run pip freeze | grep -q '^pandas==${{ matrix.pandas_v1 && '1' || '2' }}\.'
159157
158+
- name: Test mlflow
159+
run: pdm run pytest tests/integrations/test_mlflow.py::test_fast[diabetes_dataset_with_target-linear_regression_diabetes]
160+
161+
- name: Lint code
162+
run: pdm run lint
163+
160164
- name: Test code (concurrency)
161165
run: pdm test-worker
162166

@@ -205,7 +209,7 @@ jobs:
205209
- name: Setup PDM
206210
uses: pdm-project/setup-pdm@v3
207211
with:
208-
python-version: '3.10'
212+
python-version: "3.10"
209213
cache: false
210214
- name: Build wheel
211215
run: pdm build
@@ -233,7 +237,7 @@ jobs:
233237
- name: Setup PDM
234238
uses: pdm-project/setup-pdm@v3
235239
with:
236-
python-version: '3.10'
240+
python-version: "3.10"
237241
cache: false
238242
- name: Build wheel
239243
run: pdm build
@@ -252,8 +256,8 @@ jobs:
252256
- name: Setup PDM
253257
uses: pdm-project/setup-pdm@v3
254258
with:
255-
python-version: '3.10'
256-
version: '2.10.4' # Fix to repair the CI, use latest version when fixed on pdm
259+
python-version: "3.10"
260+
version: "2.10.4" # Fix to repair the CI, use latest version when fixed on pdm
257261
cache: false
258262
- name: Build wheel
259263
run: pdm build
@@ -291,7 +295,7 @@ jobs:
291295
- name: Set up Pandoc (needed for doc)
292296
uses: r-lib/actions/setup-pandoc@v2
293297
with:
294-
pandoc-version: '3.1.7' # https://github.com/jgm/pandoc/releases
298+
pandoc-version: "3.1.7" # https://github.com/jgm/pandoc/releases
295299

296300
- name: Install dependencies
297301
run: pdm install -G :all

tests/integrations/test_mlflow.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23
from tempfile import TemporaryDirectory
34

@@ -20,10 +21,11 @@ def _evaluate(dataset, model, evaluator_config):
2021
# MLFlow logic for windows seems to say : "Start with drive, no need for file:"
2122
# https://github.com/mlflow/mlflow/blob/b414a22bdead12a1865a0ab59460eb6b158db7d0/mlflow/utils/uri.py#L65C1-L66C1
2223
# Since it's not working, let's just skip it for windows..
23-
if platform.system() != "Windows":
24-
mlflow.set_tracking_uri(Path(f))
24+
if platform.system() == "Windows":
25+
f = "file:/" + f.replace(os.sep, "/")
26+
mlflow.set_tracking_uri(f)
2527
else:
26-
mlflow.set_registry_uri("")
28+
mlflow.set_tracking_uri(Path(f))
2729
experiment_id = mlflow.create_experiment("test", artifact_location=f)
2830
with mlflow.start_run(experiment_id=experiment_id):
2931
model_info = model.to_mlflow()

0 commit comments

Comments
 (0)