Skip to content

Commit

Permalink
Apply comptime in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Aug 1, 2024
1 parent b68ec33 commit 580f9c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Compile Time
run: python scripts/comptime.py 6.1
- name: Build source package
run: |
pip install cython
Expand Down Expand Up @@ -55,12 +57,17 @@ jobs:
brew install pkg-config
- name: Set deployment target
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: echo "MACOSX_DEPLOYMENT_TARGET=10.13" >> $GITHUB_ENV
run: |
echo "MACOSX_DEPLOYMENT_TARGET=10.13" >> $GITHUB_ENV
python scripts/comptime.py 7
else:
run: python scripts/comptime.py 7
- name: Build wheels
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_ALL_LINUX: yum install -y alsa-lib libxcb
CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-6.1.json /tmp/vendor
CIBW_BEFORE_BUILD_MACOS: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-7.0.json /tmp/vendor
CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py --config-file scripts\ffmpeg-6.1.json C:\cibw\vendor
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig
CIBW_ENVIRONMENT_MACOS: PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig LDFLAGS=-headerpad_max_install_names
Expand Down
6 changes: 4 additions & 2 deletions scripts/comptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def process_directory(directory):
file_path = os.path.join(root, file)
replace_in_file(file_path)

if sys.platform == "win32":

version = os.environ.get("PYAV_LIBRARY")
if version is None:
is_6 = sys.argv[1].startswith("6")
else:
is_6 = os.environ.get("PYAV_LIBRARY").startswith("ffmpeg-6")
is_6 = version.startswith("ffmpeg-6")

if is_6:
process_directory("av")
Expand Down

0 comments on commit 580f9c5

Please sign in to comment.