Skip to content

Commit

Permalink
test: Add Pydantic version to matrix variable (#890)
Browse files Browse the repository at this point in the history
* test: Add Pydantic version to matrix variable

This is a follow-up to where the Pydantic v1 shim was added [1]. It's
inspired by Ray's approach [2].

This locks the version in the CI and I think that's okay since we
don't need to keep on updating them, as they're intended as smoke
tests.

[1] #882 (comment)
[2] ray-project/ray#40451

* build: Formatting
  • Loading branch information
jesse-c committed Apr 24, 2024
1 parent ebde148 commit 653ef6d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ jobs:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.11']
pydantic-version: [ '1.10.15', '2.7.1' ]
include: # Run windows tests on only one python version
- os: windows-latest
python-version: '3.10' # torch 1.x not available on Windows or MacOS for Python 3.11
pydantic-version: '1.10.15'
- os: windows-latest
python-version: '3.10' # torch 1.x not available on Windows or MacOS for Python 3.11
pydantic-version: '2.7.1'

steps:
- name: Checkout code
Expand All @@ -52,6 +57,7 @@ jobs:
run: |
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 pydantic==${{matrix.pydantic-version}}
python -m pip install --upgrade --upgrade-strategy eager .[prophet,tensorflow,torch]
if [ "$RUNNER_OS" == "Linux" ]; then # Currently, we only support KeOps on Linux.
python -m pip install --upgrade --upgrade-strategy eager .[prophet,tensorflow,torch,keops]
Expand All @@ -67,7 +73,7 @@ jobs:
- name: Test with pytest
run: |
pytest --randomly-seed=0 alibi_detect
# Note: The pytest-randomly seed is fixed at 0 for now. Once the legacy np.random.seed(0)'s
# Note: The pytest-randomly seed is fixed at 0 for now. Once the legacy np.random.seed(0)'s
# are removed from tests, this can be removed, allowing all tests to use random seeds.
- name: Upload coverage to Codecov
Expand Down

0 comments on commit 653ef6d

Please sign in to comment.