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 53d71bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: Compile Time
run: python scripts/comptime.py 6.1
- name: Build source package
run: |
pip install cython
Expand Down Expand Up @@ -44,7 +46,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v3
Expand All @@ -55,7 +57,11 @@ 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 }}
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def parse_cflags(raw_flags):
+ list(package_dir.keys()),
package_dir=package_dir,
package_data=package_data,
python_requires=">=3.8",
python_requires=">=3.9",
zip_safe=False,
ext_modules=ext_modules,
test_suite="tests",
Expand Down

0 comments on commit 53d71bb

Please sign in to comment.