From 53d71bb547867bcd8f6800e2b09f3440147de6a9 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Thu, 1 Aug 2024 00:51:59 -0400 Subject: [PATCH] Apply comptime in tests --- .github/workflows/tests.yml | 12 +++++++++--- scripts/comptime.py | 6 ++++-- setup.py | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2e4c221d9..4c33e05a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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 }} diff --git a/scripts/comptime.py b/scripts/comptime.py index 797d125e0..a03a465f9 100644 --- a/scripts/comptime.py +++ b/scripts/comptime.py @@ -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") diff --git a/setup.py b/setup.py index 2a88c8967..92708b8e8 100644 --- a/setup.py +++ b/setup.py @@ -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",