-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathsetup.py
64 lines (55 loc) · 1.95 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import re
import platform
from setuptools import find_packages, setup
from setuptools.command.bdist_wheel import get_platform
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
NAME = "wgpu"
SUMMARY = "WebGPU for Python"
with open(f"{NAME}/__init__.py") as fh:
VERSION = re.search(r"__version__ = \"(.*?)\"", fh.read()).group(1)
class bdist_wheel(_bdist_wheel): # noqa: N801
def finalize_options(self):
self.plat_name = get_platform(None) # force a platform tag
_bdist_wheel.finalize_options(self)
resources_globs = ["*.h", "*.idl"]
if platform.system() == "Linux":
resources_globs.append("*-release.so")
elif platform.system() == "Darwin":
resources_globs.append("*-release.dylib")
elif platform.system() == "Windows":
resources_globs.append("*-release.dll")
else:
pass # don't include binaries; user will have to arrange for the lib
runtime_deps = ["cffi>=1.15.0", "rubicon-objc>=0.4.1; sys_platform == 'darwin'"]
extra_deps = {
"jupyter": ["jupyter_rfb>=0.4.2"],
"glfw": ["glfw>=1.9"],
"docs": ["sphinx>7.2", "sphinx_rtd_theme"],
"imgui": ["imgui-bundle>=1.2.1"],
}
setup(
name=NAME,
version=VERSION,
packages=find_packages(
exclude=["codegen", "codegen.*", "tests", "tests.*", "examples", "examples.*"]
),
package_data={f"{NAME}.resources": resources_globs},
python_requires=">=3.8.0",
install_requires=runtime_deps,
extras_require=extra_deps,
license="BSD 2-Clause",
description=SUMMARY,
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Almar Klein",
author_email="[email protected]",
url="https://github.com/pygfx/wgpu-py",
cmdclass={"bdist_wheel": bdist_wheel},
data_files=[("", ["LICENSE"])],
entry_points={
"pyinstaller40": [
"hook-dirs = wgpu.__pyinstaller:get_hook_dirs",
"tests = wgpu.__pyinstaller:get_test_dirs",
],
},
)