Repository navigation
72 lines (72 loc) · 2.47 KB
/
Copy pathbuild-python.yml
File metadata and controls
72 lines (72 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build tensorcodec
on:
workflow_call:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Build and check wheel and sdist
run: |
python -m pip install build twine
python -m build --outdir dist
python -m twine check --strict dist/*
- uses: actions/upload-artifact@v7
with:
name: dist-python
path: dist/*
if-no-files-found: error
test-without-av:
needs: build
strategy:
fail-fast: false
matrix:
include:
- runner: windows-2025
python: '3.12'
opencv: 'opencv-python-headless>=4.12'
- runner: macos-15-intel
python: '3.10'
opencv: 'opencv-python-headless==4.12.0.88' # lower bound for GIF and AVIF
- runner: macos-15-intel
python: '3.10'
opencv: 'opencv-python-headless==4.11.0.86' # lower bound
numpy: 'numpy==1.26.4'
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v8
with:
name: dist-python
path: dist
# Fixtures need libaom; Homebrew's FFmpeg lacks it, so use conda-forge's like the other jobs.
- uses: prefix-dev/setup-pixi@v0.10.2
env:
PIXI_HOME: ${{ runner.temp }}/pixi
with:
pixi-version: v0.81.0
run-install: false
global-environments: ffmpeg=7.1.1=gpl_*
global-cache: true
- name: Put fixture FFmpeg on PATH
env:
FFMPEG_BIN: ${{ runner.temp }}/pixi/envs/ffmpeg/${{ runner.os == 'Windows' && 'Library/bin' || 'bin' }}
run: echo "$FFMPEG_BIN" >> "$GITHUB_PATH"
- name: Install tensorcodec without tensorcodec-av
run: |
python -m pip install pytest 'Pillow>=11.3' '${{ matrix.opencv }}' '${{ matrix.numpy || 'numpy' }}'
python -m pip install --no-index --find-links dist tensorcodec
python -c "import importlib.util as u; assert u.find_spec('tensorcodec_av') is None"
- name: Test image codecs
run: python -m pytest tests/test_images.py tests/test_image_encoders.py tests/test_av_optional.py tests/test_versions.py