|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
| 15 | +"""Custom setup.py for platform-specific wheel tagging. |
| 16 | +
|
| 17 | +This file exists solely to customize the wheel platform tag. All package metadata |
| 18 | +is defined in pyproject.toml. |
| 19 | +
|
| 20 | +The native FFI libraries (.so/.dylib/.dll) require specific platform tags that |
| 21 | +respect MACOSX_DEPLOYMENT_TARGET and ARCHFLAGS environment variables set by |
| 22 | +cibuildwheel, rather than using sysconfig.get_platform() which returns Python's |
| 23 | +compile-time values. |
| 24 | +""" |
| 25 | + |
15 | 26 | import os |
16 | | -import pathlib |
17 | 27 | import platform |
18 | 28 | import sys |
19 | | -from typing import Any, Dict |
20 | 29 |
|
21 | 30 | import setuptools # type: ignore |
22 | 31 | from wheel.bdist_wheel import bdist_wheel as _bdist_wheel # type: ignore |
23 | 32 |
|
24 | | -here = pathlib.Path(__file__).parent.resolve() |
25 | | -about: Dict[Any, Any] = {} |
26 | | -with open(os.path.join(here, "livekit", "rtc", "version.py"), "r") as f: |
27 | | - exec(f.read(), about) |
28 | | - |
29 | 33 |
|
30 | 34 | def get_platform_tag(): |
31 | | - """Get the wheel platform tag for the current/target platform. |
32 | | -
|
33 | | - On macOS, we must respect MACOSX_DEPLOYMENT_TARGET and ARCHFLAGS environment |
34 | | - variables that cibuildwheel sets, rather than using sysconfig.get_platform() |
35 | | - which returns Python's compile-time values. |
36 | | - """ |
| 35 | + """Get the wheel platform tag for the current/target platform.""" |
37 | 36 | if sys.platform == "darwin": |
38 | 37 | # Get deployment target from environment (set by cibuildwheel) or fall back |
39 | 38 | target = os.environ.get("MACOSX_DEPLOYMENT_TARGET") |
@@ -72,45 +71,7 @@ def finalize_options(self): |
72 | 71 |
|
73 | 72 |
|
74 | 73 | setuptools.setup( |
75 | | - name="livekit", |
76 | | - version=about["__version__"], |
77 | | - description="Python Real-time SDK for LiveKit", |
78 | | - long_description=(here / "README.md").read_text(encoding="utf-8"), |
79 | | - long_description_content_type="text/markdown", |
80 | | - url="https://github.com/livekit/python-sdks", |
81 | 74 | cmdclass={ |
82 | 75 | "bdist_wheel": bdist_wheel, |
83 | 76 | }, |
84 | | - classifiers=[ |
85 | | - "Intended Audience :: Developers", |
86 | | - "License :: OSI Approved :: Apache Software License", |
87 | | - "Topic :: Multimedia :: Sound/Audio", |
88 | | - "Topic :: Multimedia :: Video", |
89 | | - "Topic :: Scientific/Engineering :: Artificial Intelligence", |
90 | | - "Programming Language :: Python :: 3", |
91 | | - "Programming Language :: Python :: 3.9", |
92 | | - "Programming Language :: Python :: 3.10", |
93 | | - "Programming Language :: Python :: 3 :: Only", |
94 | | - ], |
95 | | - keywords=["webrtc", "realtime", "audio", "video", "livekit"], |
96 | | - license="Apache-2.0", |
97 | | - packages=setuptools.find_namespace_packages(include=["livekit.*"]), |
98 | | - python_requires=">=3.9.0", |
99 | | - install_requires=["protobuf>=4.25.0", "types-protobuf>=3", "aiofiles>=24", "numpy>=1.26"], |
100 | | - package_data={ |
101 | | - "livekit.rtc": ["_proto/*.py", "py.typed", "*.pyi", "**/*.pyi"], |
102 | | - "livekit.rtc.resources": [ |
103 | | - "*.so", |
104 | | - "*.dylib", |
105 | | - "*.dll", |
106 | | - "LICENSE.md", |
107 | | - "*.h", |
108 | | - "jupyter-html/index.html", |
109 | | - ], |
110 | | - }, |
111 | | - project_urls={ |
112 | | - "Documentation": "https://docs.livekit.io", |
113 | | - "Website": "https://livekit.io/", |
114 | | - "Source": "https://github.com/livekit/python-sdks/", |
115 | | - }, |
116 | 77 | ) |
0 commit comments