Commit 4faf477

benny-dou <60535774+benny-dou@users.noreply.github.com>
2026-02-03 02:08:15
fix(macos): fix macOS compatibility for `onnxruntime`
1 parent fa3c01b
Changed files (2)
pyproject.toml
@@ -7,6 +7,7 @@ dependencies = [
   "brotli==1.2.0",
   "cacheout==0.16.0",
   "chardet==5.2.0",
+  "curl-cffi==0.15.0b3",
   "cutword==0.1.1",
   "dashscope==1.25.10",
   "feedgen==1.0.0",
@@ -18,9 +19,9 @@ dependencies = [
   "loguru==0.7.3",
   "markdown==3.10.1",
   "markitdown[docx,pdf,pptx,xls,xlsx]==0.1.4",
+  "onnxruntime",
   "openai==2.16.0",
   "orjson==3.11.6",
-  "onnxruntime==1.24.0.dev20251210002",
   "pathvalidate==3.3.1",
   "pillow-heif==1.2.0",
   "pillow>=11.2.1",
@@ -119,7 +120,7 @@ index-url = "https://pypi.org/simple"
 
 [tool.uv.sources]
 # jonghwanhyeon/python-ffmpeg, PR-56
-onnxruntime = { index = "ORT-Nightly" }
+onnxruntime = { index = "ORT-Nightly", marker = "sys_platform == 'linux'" }
 python-ffmpeg = { url = "https://github.com/chadawagner/python-ffmpeg/archive/4614d8b7939679ea4d6ae9c32241d7607e2b136c.zip" }
 yt-dlp = { git = "https://github.com/yt-dlp/yt-dlp.git" }
 
uv.lock
@@ -225,6 +225,7 @@ dependencies = [
     { name = "brotli", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "cacheout", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "chardet", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
+    { name = "curl-cffi", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "cutword", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "dashscope", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "feedgen", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
@@ -236,7 +237,8 @@ dependencies = [
     { name = "loguru", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "markdown", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "markitdown", extra = ["docx", "pdf", "pptx", "xls", "xlsx"], marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "onnxruntime", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
+    { name = "onnxruntime", version = "1.23.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'darwin'" },
+    { name = "onnxruntime", version = "1.24.0.dev20251210002", source = { registry = "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/" }, marker = "sys_platform == 'linux'" },
     { name = "openai", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "orjson", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "pathvalidate", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
@@ -274,6 +276,7 @@ requires-dist = [
     { name = "brotli", specifier = "==1.2.0" },
     { name = "cacheout", specifier = "==0.16.0" },
     { name = "chardet", specifier = "==5.2.0" },
+    { name = "curl-cffi", specifier = "==0.15.0b3" },
     { name = "cutword", specifier = "==0.1.1" },
     { name = "dashscope", specifier = "==1.25.10" },
     { name = "feedgen", specifier = "==1.0.0" },
@@ -285,7 +288,8 @@ requires-dist = [
     { name = "loguru", specifier = "==0.7.3" },
     { name = "markdown", specifier = "==3.10.1" },
     { name = "markitdown", extras = ["docx", "pdf", "pptx", "xls", "xlsx"], specifier = "==0.1.4" },
-    { name = "onnxruntime", specifier = "==1.24.0.dev20251210002", index = "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/" },
+    { name = "onnxruntime", marker = "sys_platform != 'linux'" },
+    { name = "onnxruntime", marker = "sys_platform == 'linux'", index = "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/" },
     { name = "openai", specifier = "==2.16.0" },
     { name = "orjson", specifier = "==3.11.6" },
     { name = "pathvalidate", specifier = "==3.3.1" },
@@ -596,23 +600,29 @@ wheels = [
 
 [[package]]
 name = "curl-cffi"
-version = "0.14.0"
+version = "0.15.0b3"
 source = { registry = "https://pypi.org/simple" }
 dependencies = [
     { name = "certifi", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "cffi", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
 ]
-sdist = { url = "https://files.pythonhosted.org/packages/9b/c9/0067d9a25ed4592b022d4558157fcdb6e123516083700786d38091688767/curl_cffi-0.14.0.tar.gz", hash = "sha256:5ffbc82e59f05008ec08ea432f0e535418823cda44178ee518906a54f27a5f0f", size = 162633, upload-time = "2025-12-16T03:25:07.931Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/0c/ff/e19da61fe0fbe830f5bf07868702bb9d920cfa71735c3647ee4ec2fd316d/curl_cffi-0.15.0b3.tar.gz", hash = "sha256:15c7d5f5782e14287dde77e195a695e84cf720de5d74cb90b2b1d90601b833f4", size = 181909, upload-time = "2026-02-02T09:27:13.193Z" }
 wheels = [
-    { url = "https://files.pythonhosted.org/packages/aa/f0/0f21e9688eaac85e705537b3a87a5588d0cefb2f09d83e83e0e8be93aa99/curl_cffi-0.14.0-cp39-abi3-macosx_14_0_arm64.whl", hash = "sha256:e35e89c6a69872f9749d6d5fda642ed4fc159619329e99d577d0104c9aad5893", size = 3087277, upload-time = "2025-12-16T03:24:49.607Z" },
-    { url = "https://files.pythonhosted.org/packages/ba/a3/0419bd48fce5b145cb6a2344c6ac17efa588f5b0061f212c88e0723da026/curl_cffi-0.14.0-cp39-abi3-macosx_15_0_x86_64.whl", hash = "sha256:5945478cd28ad7dfb5c54473bcfb6743ee1d66554d57951fdf8fc0e7d8cf4e45", size = 5804650, upload-time = "2025-12-16T03:24:51.518Z" },
-    { url = "https://files.pythonhosted.org/packages/e2/07/a238dd062b7841b8caa2fa8a359eb997147ff3161288f0dd46654d898b4d/curl_cffi-0.14.0-cp39-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c42e8fa3c667db9ccd2e696ee47adcd3cd5b0838d7282f3fc45f6c0ef3cfdfa7", size = 8231918, upload-time = "2025-12-16T03:24:52.862Z" },
-    { url = "https://files.pythonhosted.org/packages/7c/d2/ce907c9b37b5caf76ac08db40cc4ce3d9f94c5500db68a195af3513eacbc/curl_cffi-0.14.0-cp39-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:060fe2c99c41d3cb7f894de318ddf4b0301b08dca70453d769bd4e74b36b8483", size = 8654624, upload-time = "2025-12-16T03:24:54.579Z" },
-    { url = "https://files.pythonhosted.org/packages/f2/ae/6256995b18c75e6ef76b30753a5109e786813aa79088b27c8eabb1ef85c9/curl_cffi-0.14.0-cp39-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b158c41a25388690dd0d40b5bc38d1e0f512135f17fdb8029868cbc1993d2e5b", size = 8010654, upload-time = "2025-12-16T03:24:56.507Z" },
-    { url = "https://files.pythonhosted.org/packages/fb/10/ff64249e516b103cb762e0a9dca3ee0f04cf25e2a1d5d9838e0f1273d071/curl_cffi-0.14.0-cp39-abi3-manylinux_2_28_i686.whl", hash = "sha256:1439fbef3500fb723333c826adf0efb0e2e5065a703fb5eccce637a2250db34a", size = 7781969, upload-time = "2025-12-16T03:24:57.885Z" },
-    { url = "https://files.pythonhosted.org/packages/51/76/d6f7bb76c2d12811aa7ff16f5e17b678abdd1b357b9a8ac56310ceccabd5/curl_cffi-0.14.0-cp39-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e7176f2c2d22b542e3cf261072a81deb018cfa7688930f95dddef215caddb469", size = 7969133, upload-time = "2025-12-16T03:24:59.261Z" },
-    { url = "https://files.pythonhosted.org/packages/23/7c/cca39c0ed4e1772613d3cba13091c0e9d3b89365e84b9bf9838259a3cd8f/curl_cffi-0.14.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:03f21ade2d72978c2bb8670e9b6de5260e2755092b02d94b70b906813662998d", size = 9080167, upload-time = "2025-12-16T03:25:00.946Z" },
-    { url = "https://files.pythonhosted.org/packages/75/03/a942d7119d3e8911094d157598ae0169b1c6ca1bd3f27d7991b279bcc45b/curl_cffi-0.14.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:58ebf02de64ee5c95613209ddacb014c2d2f86298d7080c0a1c12ed876ee0690", size = 9520464, upload-time = "2025-12-16T03:25:02.922Z" },
+    { url = "https://files.pythonhosted.org/packages/f7/b0/6ce35dac08d6bea127edf5bbacf2077def19304bd55e84d4fbf645db914f/curl_cffi-0.15.0b3-cp310-abi3-macosx_10_9_x86_64.whl", hash = "sha256:ba8facca7643384e0a197d5ad25a711dad1189521f2b36dd882669a864465cd8", size = 2753934, upload-time = "2026-02-02T09:26:32.722Z" },
+    { url = "https://files.pythonhosted.org/packages/d7/8d/cf3fcab5902257bf4bc243a21b3b252528f35023232383b4c342a58bfeaf/curl_cffi-0.15.0b3-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:b9d23d5f045ed71ada1e71de6cd1efa247eb4606461b3b2936ed975efb018fb4", size = 2534627, upload-time = "2026-02-02T09:26:34.505Z" },
+    { url = "https://files.pythonhosted.org/packages/6f/b0/62cb93a76430c7287c92e1cdcac35d9530d37a7adcded86507abebbf5b5e/curl_cffi-0.15.0b3-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d933789572e72cb492514bc13ea33c3f44464c7763cca91b35f0d8f5e4a3cf50", size = 10443930, upload-time = "2026-02-02T09:26:36.439Z" },
+    { url = "https://files.pythonhosted.org/packages/e9/d3/50ccdcec6f7d0d7d3e86f953ec3caaf866f5ce0dc5d05cdeed211817f8dc/curl_cffi-0.15.0b3-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:2d21c720796e297bb49075fc904cfa76ec31cdad7b602a8060c235b84197292e", size = 10092843, upload-time = "2026-02-02T09:26:39.425Z" },
+    { url = "https://files.pythonhosted.org/packages/9f/09/d4922e27583bc3cc21e114f96a5a3b060ce60cec8020ca07e8a075d5ca4a/curl_cffi-0.15.0b3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:be72c34d404615cc72bc61028a83ccf5fd379c438c2dda1e7c9c5f0afd63ba40", size = 11012732, upload-time = "2026-02-02T09:26:41.649Z" },
+    { url = "https://files.pythonhosted.org/packages/fd/69/6fcab0b8622c523bbe6bfcd4e0acb7ee651d8dc4f83f60a4c8e2b444114c/curl_cffi-0.15.0b3-cp310-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:622e32b15f5c860efbc78f59de37d248e441aee8011b7cc3752792d0e40e57e9", size = 10404065, upload-time = "2026-02-02T09:26:45.256Z" },
+    { url = "https://files.pythonhosted.org/packages/64/b2/3df9970244070d71d373943cad74345c69c3156e2dcc674aa62dd84eb8ca/curl_cffi-0.15.0b3-cp310-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f88db7cc1341ed4e43c6d36f4de654acc0c9b0bfb3ccd54b77a0506cdc7cb72a", size = 10231074, upload-time = "2026-02-02T09:26:47.269Z" },
+    { url = "https://files.pythonhosted.org/packages/95/69/46e487cf8ac7b9ea2c3c885e116f3117ebf9bb6cfa1bfeb750b59134627f/curl_cffi-0.15.0b3-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:afbfe559da94b69ef5cda9a12e5fb1bc32e2a8241593d096c716523298e78364", size = 11226171, upload-time = "2026-02-02T09:26:49.239Z" },
+    { url = "https://files.pythonhosted.org/packages/0c/07/232f8eb3d5c17e719ab849e2404fc01e62dbb3014c4f2bb32e6196da27f2/curl_cffi-0.15.0b3-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e970f26945372a437d09fa8cd3877740dc28eec5cb6562e11294b05b682ec8bb", size = 11863877, upload-time = "2026-02-02T09:26:52.081Z" },
+    { url = "https://files.pythonhosted.org/packages/7d/e9/3e311372bce4f13c210a2f82fe0ccb02ade17b880cd21750cc7180ac79b0/curl_cffi-0.15.0b3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:76f74165ccbe5402868fadf36d120b831396fb405c8e7b1fd1a8f1a4a0c60c36", size = 2754554, upload-time = "2026-02-02T09:26:59.409Z" },
+    { url = "https://files.pythonhosted.org/packages/5f/f3/adb6f746918b63bbee3a37402496996639e89c85daac8b8adc62e0dfb9d6/curl_cffi-0.15.0b3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:884572e88fabc080cb856c9757cadc449373aa6bdd5a6bd5506edbd2e858b37e", size = 2534817, upload-time = "2026-02-02T09:27:01.334Z" },
+    { url = "https://files.pythonhosted.org/packages/2d/fc/39751406ed769356e9cb2a761f616726110effd18101d56d5c8e763198bd/curl_cffi-0.15.0b3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1e73dcfdd1f3bdd7bc010522bd43256f47d07d36a66c6941797cc07a02b57fe0", size = 10446405, upload-time = "2026-02-02T09:27:03.238Z" },
+    { url = "https://files.pythonhosted.org/packages/f7/da/bbd1e840ceadf2554a5edbd742ea1f542fa4dbbeff85084a7aae7dd41a8d/curl_cffi-0.15.0b3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:35403aa12494a871a77ae30df134951be154d52db1b410fac7719d478729572a", size = 11019078, upload-time = "2026-02-02T09:27:05.121Z" },
+    { url = "https://files.pythonhosted.org/packages/05/c4/880f755417ae3c90ca21b67771dcb7481e5ca062785d619871852a36d00d/curl_cffi-0.15.0b3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:b1e8dc4902b42013324d5a6138a97d80d05f27f6641c374524a125487f7c55fe", size = 11229637, upload-time = "2026-02-02T09:27:07.141Z" },
+    { url = "https://files.pythonhosted.org/packages/c7/93/547bd41efafabe8cbbed94dfeb19c789b4500c4ceeb5fb469db326325574/curl_cffi-0.15.0b3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7ad428caa442486749445cb002a158934673e9b9805a172d23c3ac7868078090", size = 11869188, upload-time = "2026-02-02T09:27:09.335Z" },
 ]
 
 [[package]]
@@ -1128,7 +1138,8 @@ source = { registry = "https://pypi.org/simple" }
 dependencies = [
     { name = "click", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
     { name = "numpy", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "onnxruntime", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
+    { name = "onnxruntime", version = "1.23.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'darwin'" },
+    { name = "onnxruntime", version = "1.24.0.dev20251210002", source = { registry = "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/" }, marker = "sys_platform == 'linux'" },
     { name = "python-dotenv", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
 ]
 sdist = { url = "https://files.pythonhosted.org/packages/a3/f3/3d1dcdd7b9c41d589f5cff252d32ed91cdf86ba84391cfc81d9d8773571d/magika-0.6.3.tar.gz", hash = "sha256:7cc52aa7359af861957043e2bf7265ed4741067251c104532765cd668c0c0cb1", size = 3042784, upload-time = "2025-10-30T15:22:34.499Z" }
@@ -1346,17 +1357,42 @@ wheels = [
     { url = "https://files.pythonhosted.org/packages/c8/b8/54bdb43b6225badbea6389fa038c4ef868c44f5890f95dd530a218706da3/numpy-2.4.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5daf6f3914a733336dab21a05cdec343144600e964d2fcdabaac0c0269874b2a", size = 18380024, upload-time = "2026-01-31T23:12:44.331Z" },
 ]
 
+[[package]]
+name = "onnxruntime"
+version = "1.23.2"
+source = { registry = "https://pypi.org/simple" }
+resolution-markers = [
+    "python_full_version >= '3.14' and sys_platform == 'darwin'",
+    "python_full_version < '3.14' and sys_platform == 'darwin'",
+]
+dependencies = [
+    { name = "coloredlogs", marker = "sys_platform == 'darwin'" },
+    { name = "flatbuffers", marker = "sys_platform == 'darwin'" },
+    { name = "numpy", marker = "sys_platform == 'darwin'" },
+    { name = "packaging", marker = "sys_platform == 'darwin'" },
+    { name = "protobuf", marker = "sys_platform == 'darwin'" },
+    { name = "sympy", marker = "sys_platform == 'darwin'" },
+]
+wheels = [
+    { url = "https://files.pythonhosted.org/packages/3d/41/fba0cabccecefe4a1b5fc8020c44febb334637f133acefc7ec492029dd2c/onnxruntime-1.23.2-cp313-cp313-macosx_13_0_arm64.whl", hash = "sha256:2ff531ad8496281b4297f32b83b01cdd719617e2351ffe0dba5684fb283afa1f", size = 17196337, upload-time = "2025-10-22T03:46:35.168Z" },
+    { url = "https://files.pythonhosted.org/packages/fe/f9/2d49ca491c6a986acce9f1d1d5fc2099108958cc1710c28e89a032c9cfe9/onnxruntime-1.23.2-cp313-cp313-macosx_13_0_x86_64.whl", hash = "sha256:162f4ca894ec3de1a6fd53589e511e06ecdc3ff646849b62a9da7489dee9ce95", size = 19157691, upload-time = "2025-10-22T03:46:43.518Z" },
+]
+
 [[package]]
 name = "onnxruntime"
 version = "1.24.0.dev20251210002"
 source = { registry = "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/" }
+resolution-markers = [
+    "python_full_version >= '3.14' and sys_platform == 'linux'",
+    "python_full_version < '3.14' and sys_platform == 'linux'",
+]
 dependencies = [
-    { name = "coloredlogs", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "flatbuffers", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "numpy", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "packaging", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "protobuf", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
-    { name = "sympy", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
+    { name = "coloredlogs", marker = "sys_platform == 'linux'" },
+    { name = "flatbuffers", marker = "sys_platform == 'linux'" },
+    { name = "numpy", marker = "sys_platform == 'linux'" },
+    { name = "packaging", marker = "sys_platform == 'linux'" },
+    { name = "protobuf", marker = "sys_platform == 'linux'" },
+    { name = "sympy", marker = "sys_platform == 'linux'" },
 ]
 wheels = [
     { url = "https://aiinfra.pkgs.visualstudio.com/2692857e-05ef-43b4-ba9c-ccf1c22c437c/_packaging/7982ae20-ed19-4a35-a362-a96ac99897b7/pypi/download/onnxruntime/1.24.dev20251210002/onnxruntime-1.24.0.dev20251210002-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fa41ed37507109fe70b62856ecc5fc5a8e1b96114d3a96fbe0072f91326a558b" },