@@ -2,13 +2,23 @@ name: Python package
22
33on : [push]
44
5+ env :
6+ UV_LINK_MODE : " symlink"
7+
58jobs :
69 build :
710 runs-on : ubuntu-latest
811 strategy :
912 matrix :
1013 python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
11-
14+ include :
15+ - python-version : " 3.8"
16+ numpy-version : " <2.0"
17+ torch-version : " disable"
18+ torch-pip : " torch==1.13.1+cpu torchvision==0.14.1+cpu --index-url https://download.pytorch.org/whl/cpu"
19+
20+ - python-version : " 3.12"
21+ numpy-version : " >=2.0"
1222 steps :
1323 - uses : actions/checkout@v4
1424
1727 with :
1828 python-version : ${{ matrix.python-version }}
1929
20- - name : Install dependencies
21- run : uv sync --all-extras
30+ - name : Install specific numpy version
31+ if : matrix.numpy-version != ''
32+ run : uv pip install "numpy${{ matrix.numpy-version }}"
33+
34+ - name : Install w/specific PyTorch version
35+ if : ( matrix.torch-version != '' ) && ( matrix.torch-version != 'disable' )
36+ run : uv sync --extra video --extra dev --extra ${{ matrix.torch-version }}
37+
38+ - name : Install w/CPU PyTorch version
39+ if : matrix.torch-version != 'disable'
40+ run : uv sync --extra video --extra dev --extra cpu
41+
42+ - name : Install w/o PyTorch
43+ if : matrix.torch-version == 'disable'
44+ run : uv sync --extra video --extra dev
45+
46+ - name : Install PyTorch w/Pip
47+ if : matrix.torch-pip != ''
48+ run : uv pip install ${{ matrix.torch-pip }}
49+
50+ # We intentionally run again since some envs force specific numpy versions in this way.
51+ - name : Install specific numpy version
52+ if : matrix.numpy-version != ''
53+ run : uv pip install "numpy${{ matrix.numpy-version }}"
2254
2355 - name : Display Python version
2456 run : uv run python -c "import sys; print(sys.version)"
2759 run : uv pip uninstall opencv-python && uv pip install opencv-python-headless
2860
2961 - name : Test with pytest
30- run : uv run pytest
62+ run : |
63+ uv pip install pytest
64+ uv run pytest -k 'test_concat' # uv run pytest
0 commit comments