File tree 3 files changed +31
-6
lines changed
3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,20 @@ jobs:
44
44
- os : windows-latest
45
45
python-version : " 3.11"
46
46
extras : " test"
47
- name : windows- 3.11
47
+ name : 3.11-windows
48
48
- os : macos-latest
49
49
python-version : " 3.11"
50
50
extras : " test"
51
- name : macos- 3.11
51
+ name : 3.11-macos
52
52
# Also run tests with only the core dependencies, to ensure we
53
53
# cover the latest version of numpy/pandas. See dsgibbons#46
54
54
- os : ubuntu-latest
55
55
python-version : " 3.11"
56
56
extras : " test-core"
57
- name : core- 3.11
57
+ name : 3.11-core
58
58
fail-fast : false
59
- # Workaround to ensure job name stays the same, so "Required Checks" still present
59
+ # Workaround to ensure previous job names stay the same
60
+ # "Required Checks" enfore that a check called "run_tests (3.8)" is present
60
61
name : run_tests (${{ matrix.name && matrix.name || matrix.python-version }})
61
62
runs-on : ${{ matrix.os }}
62
63
steps :
@@ -88,14 +89,14 @@ jobs:
88
89
# - Use "append" import mode rather than default "prepend"
89
90
run : >
90
91
pytest --durations=20
91
- --cov=shap --cov-report=xml --cov-report=term-missing
92
+ --cov --cov-report=xml
92
93
--mpl-generate-summary=html --mpl-results-path=./mpl-results
93
94
--import-mode=append
94
95
- name : Upload mpl test report
95
96
if : failure()
96
97
uses : actions/upload-artifact@v3
97
98
with :
98
- name : mpl-results-${{ matrix.python-version }}
99
+ name : mpl-results-${{ matrix.python-version }}-${{ runner.os }}-${{ matrix.extras }}
99
100
path : mpl-results/
100
101
if-no-files-found : ignore
101
102
- name : Upload coverage to Codecov
Original file line number Diff line number Diff line change @@ -105,6 +105,12 @@ target-version = "py37"
105
105
"shap/explainers/other/_maple.py" = [" ALL" ]
106
106
"shap/plots/colors/_colorconv.py" = [" ALL" ]
107
107
108
+ [tool .coverage .run ]
109
+ source_pkgs = [" shap" ]
110
+
111
+ [tool .coverage .paths ]
112
+ combine = [" shap" , " */site-packages/shap" ]
113
+
108
114
[tool .cibuildwheel ]
109
115
# Restrict the set of builds to mirror the wheels available in scikit-learn. See #3028
110
116
skip = [" cp36-*" , " pp*" , " *-musllinux_*" ]
Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ import pytest
4
+
5
+
6
+ @pytest .mark .skipif (
7
+ os .getenv ("GITHUB_ACTIONS" ) != "true" , reason = "Only enforced when running on CI"
8
+ )
9
+ def test_importing_from_installed_package_not_local_files ():
10
+
11
+ # If using an editable install (pip install --editable), then shap will
12
+ # be imported directly from the repo. This is a common setup when developing.
13
+
14
+ # However when running tests on CI, we want to test against the *installed* package.
15
+ # This ensures that the library is packaged correctly.
16
+
17
+ import shap
18
+ assert "site-packages" in shap .__file__
You can’t perform that action at this time.
0 commit comments