Fix Python dependency issues #682
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unittest for Python | |
on: | |
push: | |
paths-ignore: | |
- 'javascript/**' | |
- 'java/**' | |
pull_request: | |
paths-ignore: | |
- 'javascript/**' | |
- 'java/**' | |
permissions: | |
contents: read | |
jobs: | |
python-unittest: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.8, 3.9, '3.10'] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- name: Setup python ${{ matrix.python-version }} | |
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install ".[dev]" | |
- name: Run unittest | |
run: pytest ./tests | |
- name: Install Jax | |
if: ${{ matrix.os != 'windows-latest' && matrix.python-version >= '3.9' }} | |
run: pip install ".[jaxcpu]" | |
- name: Run unittest with Jax | |
if: ${{ matrix.os != 'windows-latest' && matrix.python-version >= '3.9' }} | |
run: pytest ./scripts/tests |