Skip to content

Commit

Permalink
Add Python 3.10 (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascillitoe committed Apr 26, 2022
1 parent 6ce8a51 commit 1fd0e79
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [ '3.7', '3.8', '3.9' ]
include: # Run macos and windows tests on python 3.9 only
- os: windows-latest
python-version: '3.9'
- os: macos-latest
python-version: '3.9'
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
include: # Run macos and windows tests on only one python version
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.10'

steps:
- name: Checkout code
Expand All @@ -50,7 +50,9 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt
python -m pip install --upgrade --upgrade-strategy eager -e .
if [ "$RUNNER_OS" != "Windows" ]; then # Skip distributed tests on windows for now (Windows support for ray is experimental https://docs.ray.io/en/latest/installation.html#windows-support)
if [ "$RUNNER_OS" != "Windows" ] && [ ${{ matrix.python }} < '3.10' ]; then
# Windows support for ray is experimental (https://docs.ray.io/en/latest/installation.html#windows-support)
# Python 3.10 is not yet supported (https://github.com/ray-project/ray/blob/master/python/setup.py#L24)
python -m pip install --upgrade --upgrade-strategy eager -e .[ray]
fi
python -m pip install --upgrade --upgrade-strategy eager -e .[shap]
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/test_all_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
fail-fast: false # Continue to run other builds despite a failure
matrix:
os: [ubuntu-latest]
python-version: [ '3.7', '3.8', '3.9' ]
include: # Run macos and windows tests on python 3.9 only
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
include: # Run macos and windows tests on only one python version
- os: windows-latest
python-version: '3.9'
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.9'
python-version: '3.10'

steps:
- name: Checkout code
Expand All @@ -41,7 +41,9 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt -r testing/requirements.txt
python -m pip install --upgrade --upgrade-strategy eager -e .
if [ "$RUNNER_OS" != "Windows" ]; then # Skip distributed tests on windows for now (Windows support for ray is experimental https://docs.ray.io/en/latest/installation.html#windows-support)
if [ "$RUNNER_OS" != "Windows" ] && [ ${{ matrix.python }} < '3.10' ]; then
# Windows support for ray is experimental (https://docs.ray.io/en/latest/installation.html#windows-support)
# Python 3.10 is not yet supported (https://github.com/ray-project/ray/blob/master/python/setup.py#L24)
python -m pip install --upgrade --upgrade-strategy eager -e .[ray]
fi
python -m pip install --upgrade --upgrade-strategy eager -e .[shap]
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/test_changed_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [ '3.7', '3.8', '3.9' ]
include: # Run macos and windows tests on python 3.9 only
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
include: # Run macos and windows tests on only one python version
- os: windows-latest
python-version: '3.9'
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.9'
python-version: '3.10'

steps:
- name: Checkout code
Expand All @@ -57,7 +57,9 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt -r testing/requirements.txt
python -m pip install --upgrade --upgrade-strategy eager -e .
if [ "$RUNNER_OS" != "Windows" ]; then # Skip distributed tests on windows for now (Windows support for ray is experimental https://docs.ray.io/en/latest/installation.html#windows-support)
if [ "$RUNNER_OS" != "Windows" ] && [ ${{ matrix.python }} < '3.10' ]; then
# Windows support for ray is experimental (https://docs.ray.io/en/latest/installation.html#windows-support)
# Python 3.10 is not yet supported (https://github.com/ray-project/ray/blob/master/python/setup.py#L24)
python -m pip install --upgrade --upgrade-strategy eager -e .[ray]
fi
python -m pip install --upgrade --upgrade-strategy eager -e .[shap]
Expand Down
2 changes: 1 addition & 1 deletion alibi/explainers/tests/test_shap_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ def test_explain_tree(caplog, monkeypatch, mock_tree_shap_explainer, data_type,
explainer._check_explainer_setup.assert_not_called()
explainer._check_interactions.assert_called_with(False, background_data, None)
else:
explainer._check_interactions.asert_not_called()
explainer._check_interactions.assert_not_called()
explainer._check_explainer_setup.assert_called_with(background_data, explainer.model_output, None)

explainer._build_explanation.assert_called_once()
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def readme():
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering",
],
Expand Down

0 comments on commit 1fd0e79

Please sign in to comment.