diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index a8bed529b..d6651f4ee 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -35,10 +35,9 @@ jobs: fail-fast: false matrix: config: - - {os: ubuntu-24.04, python: "3.14t", ffmpeg: "8.0.1", extras: true} - {os: ubuntu-24.04, python: "3.12", ffmpeg: "8.0.1", extras: true} - - {os: ubuntu-24.04, python: "pypy3.10", ffmpeg: "8.0.1"} - - {os: macos-14, python: "3.10", ffmpeg: "8.0.1"} + # - {os: ubuntu-24.04, python: "pypy3.11", ffmpeg: "8.0.1"} + - {os: macos-14, python: "3.11", ffmpeg: "8.0.1"} env: PYAV_PYTHON: python${{ matrix.config.python }} @@ -122,7 +121,7 @@ jobs: fail-fast: false matrix: config: - - {os: windows-latest, python: "3.10", ffmpeg: "latest"} + - {os: windows-latest, python: "3.11", ffmpeg: "latest"} steps: - name: Checkout diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7611e4f18..efa8de710 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,9 +40,9 @@ jobs: arch: AMD64 steps: - uses: actions/checkout@v6 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: - python-version: "3.13" + python-version: "3.14" - name: Set Minimum MacOS Target if: runner.os == 'macOS' run: | @@ -61,10 +61,9 @@ jobs: CIBW_ENVIRONMENT_MACOS: PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig LDFLAGS=-headerpad_max_install_names CIBW_ENVIRONMENT_WINDOWS: INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib PYAV_SKIP_TESTS=unicode_filename CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel} - CIBW_SKIP: "pp*" + CIBW_SKIP: "pp* cp312* cp313* cp314*" CIBW_TEST_COMMAND: mv {project}/av {project}/av.disabled && python -m pytest {package}/tests && mv {project}/av.disabled {project}/av CIBW_TEST_REQUIRES: pytest numpy - CIBW_ENABLE: cpython-freethreading run: | pip install cibuildwheel delvewheel cibuildwheel --output-dir dist diff --git a/pyproject.toml b/pyproject.toml index 24bdc90a9..7ab4ae2ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ {name = "WyattBlue", email = "wyattblue@auto-editor.com"}, {name = "Jeremy Lainé", email = "jeremy.laine@m4x.org"}, ] -requires-python = ">=3.10" +requires-python = ">=3.11" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -20,7 +20,6 @@ classifiers = [ "Operating System :: Unix", "Operating System :: Microsoft :: Windows", "Programming Language :: Cython", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", diff --git a/setup.py b/setup.py index ce6bcc388..1db60b649 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,12 @@ "swresample", ] +if sys.implementation.name == "cpython": + py_limited_api = True + options = {"bdist_wheel": {"py_limited_api": "cp311"}} +else: + py_limited_api = False + options = {} # Monkey-patch Cython to not overwrite embedded signatures. old_embed_signature = EmbedSignature._embed_signature @@ -142,6 +148,8 @@ def parse_cflags(raw_flags): include_dirs=[f"{IMPORT_NAME}/filter"] + extension_extra["include_dirs"], libraries=extension_extra["libraries"], library_dirs=extension_extra["library_dirs"], + define_macros=[("Py_LIMITED_API", 0x030B0000)], + py_limited_api=py_limited_api, ) compiler_directives = { @@ -186,6 +194,8 @@ def parse_cflags(raw_flags): libraries=extension_extra["libraries"], library_dirs=extension_extra["library_dirs"], sources=[pyx_path], + define_macros=[("Py_LIMITED_API", 0x030B0000)], + py_limited_api=py_limited_api, ), compiler_directives=compiler_directives, build_dir="src", @@ -202,4 +212,5 @@ def parse_cflags(raw_flags): packages=find_packages(include=[f"{IMPORT_NAME}*"]), package_data=package_data, ext_modules=ext_modules, + options=options, )