Skip to content

Commit 444874f

Browse files
Include ffmpeg suitable for Apple Silicon macos arm64 platform (#114)
* Include ffmpeg suitable for Apple Silicon, macos arm64 * Update imageio_ffmpeg/_definitions.py, apple silicon binary filename ffmpeg-osx-arm64-v7.0 * Update imageio_ffmpeg/_definitions.py osx64 ffmpeg binary filename * Update imageio_ffmpeg/_definitions.py, simpler osxarmplats string * Update imageio_ffmpeg/_definitions.py, simpler osxplats string * black * update pyversion support --------- Co-authored-by: Almar Klein <[email protected]>
1 parent b57f3a6 commit 444874f

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
fail-fast: false
1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.10
20+
- name: Set up Python
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: '3.10'
23+
python-version: '3.13'
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
@@ -38,34 +38,34 @@ jobs:
3838
matrix:
3939
include:
4040
# Python versions
41-
- name: Linux py37
42-
os: ubuntu-latest
43-
pyversion: '3.7'
44-
- name: Linux py38
45-
os: ubuntu-latest
46-
pyversion: '3.8'
4741
- name: Linux py39
4842
os: ubuntu-latest
4943
pyversion: '3.9'
5044
- name: Linux py310
5145
os: ubuntu-latest
5246
pyversion: '3.10'
47+
- name: Linux py311
48+
os: ubuntu-latest
49+
pyversion: '3.11'
5350
- name: Linux py312
5451
os: ubuntu-latest
5552
pyversion: '3.12'
53+
- name: Linux py313
54+
os: ubuntu-latest
55+
pyversion: '3.13'
5656
- name: Linux pypy
5757
os: ubuntu-latest
5858
pyversion: 'pypy3.9'
5959
# OS's
60-
- name: Linux py311
60+
- name: Linux py313
6161
os: ubuntu-latest
62-
pyversion: '3.11'
63-
- name: Windows py311
62+
pyversion: '3.13'
63+
- name: Windows py313
6464
os: windows-latest
65-
pyversion: '3.11'
66-
- name: MacOS py311
65+
pyversion: '3.13'
66+
- name: MacOS py313
6767
os: macos-latest
68-
pyversion: '3.11'
68+
pyversion: '3.13'
6969
steps:
7070
- uses: actions/checkout@v4
7171
- name: Set up Python ${{ matrix.pyversion }}

imageio_ffmpeg/_definitions.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
import platform
22
import struct
3-
import sys
43

54
__version__ = "0.5.1"
65

76

87
def get_platform():
98
bits = struct.calcsize("P") * 8
10-
if sys.platform.startswith("linux"):
9+
if platform.system().lower().startswith("linux"):
1110
architecture = platform.machine()
1211
if architecture == "aarch64":
1312
return "linuxaarch64"
1413
return "linux{}".format(bits)
15-
elif sys.platform.startswith("freebsd"):
14+
elif platform.system().lower().startswith("freebsd"):
1615
return "freebsd{}".format(bits)
17-
elif sys.platform.startswith("win"):
16+
elif platform.system().lower().startswith("win"):
1817
return "win{}".format(bits)
19-
elif sys.platform.startswith("cygwin"):
18+
elif platform.system().lower().startswith("cygwin"):
2019
return "win{}".format(bits)
21-
elif sys.platform.startswith("darwin"):
22-
return "osx{}".format(bits)
20+
elif platform.system().lower().startswith("darwin"):
21+
if platform.processor().lower().startswith("arm"): # Apple Silicon
22+
return "osx-arm{}".format(bits)
23+
else:
24+
return "osx-{}".format(bits)
2325
else: # pragma: no cover
2426
return None
2527

@@ -34,21 +36,24 @@ def get_platform():
3436

3537
# Platform string -> ffmpeg filename
3638
FNAME_PER_PLATFORM = {
37-
"osx64": "ffmpeg-osx64-v4.2.2", # 10.10+
39+
"osx-arm64": "ffmpeg-osx-arm64-v7.0", # Apple Silicon
40+
"osx64": "ffmpeg-osx-x86-v7.0", # 10.9+
3841
"win32": "ffmpeg-win32-v4.2.2.exe", # Windows 7+
3942
"win64": "ffmpeg-win64-v4.2.2.exe",
4043
# "linux32": "ffmpeg-linux32-v4.2.2",
4144
"linux64": "ffmpeg-linux64-v4.2.2", # Kernel 3.2.0+
4245
"linuxaarch64": "ffmpeg-linuxaarch64-v4.2.2",
4346
}
4447

45-
osxplats = "macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64"
48+
osxplats = "macosx_10_9_intel.macosx_10_9_x86_64"
49+
osxarmplats = "macosx_11_0_arm64"
4650

4751
# Wheel tag -> platform string
4852
WHEEL_BUILDS = {
4953
"py3-none-manylinux2010_x86_64": "linux64",
5054
"py3-none-manylinux2014_aarch64": "linuxaarch64",
51-
"py3-none-" + osxplats: "osx64",
55+
"py3-none-" + osxplats: "osx64", # Apple Intel
56+
"py3-none-" + osxarmplats: "osx-arm64", # Apple Silicon
5257
"py3-none-win32": "win32",
5358
"py3-none-win_amd64": "win64",
5459
}

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
long_description=long_description,
5757
platforms="any",
5858
provides=["imageio_ffmpeg"],
59-
python_requires=">=3.5",
59+
python_requires=">=3.9",
6060
setup_requires=[],
6161
install_requires=[],
6262
packages=["imageio_ffmpeg", "imageio_ffmpeg.binaries"],
@@ -74,11 +74,10 @@
7474
"Operating System :: POSIX",
7575
"Programming Language :: Python",
7676
"Programming Language :: Python :: 3",
77-
"Programming Language :: Python :: 3.7",
78-
"Programming Language :: Python :: 3.8",
7977
"Programming Language :: Python :: 3.9",
8078
"Programming Language :: Python :: 3.10",
8179
"Programming Language :: Python :: 3.11",
8280
"Programming Language :: Python :: 3.12",
81+
"Programming Language :: Python :: 3.13",
8382
],
8483
)

0 commit comments

Comments
 (0)