forked from szabolcsdombi/zengl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
135 lines (119 loc) · 3.8 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import os
import sys
from setuptools import Extension, setup
py_limited_api = False
extra_compile_args = []
extra_link_args = []
define_macros = []
cmdclass = {}
stubs = {
"packages": ["zengl-stubs"],
"package_data": {"zengl-stubs": ["__init__.pyi"]},
"include_package_data": True,
}
if sys.platform.startswith("darwin"):
extra_compile_args += ["-Wno-writable-strings"]
if os.getenv("PYODIDE"):
define_macros += [("EXTERN_GL", None)]
if os.getenv("ZENGL_COVERAGE"):
extra_compile_args += ["-O0", "--coverage"]
extra_link_args += ["-O0", "--coverage"]
if os.getenv("ZENGL_WARNINGS"):
if sys.platform.startswith("linux"):
extra_compile_args += [
"-g3",
"-Wall",
"-Wextra",
"-Wconversion",
"-Wdouble-promotion",
"-Wno-unused-parameter",
"-Wno-cast-function-type",
"-Werror",
]
extra_link_args += [
"-fsanitize=undefined",
]
if os.getenv("ZENGL_NO_STUBS"):
stubs = {}
if sys.hexversion >= 0x030B0000:
from wheel.bdist_wheel import bdist_wheel
class bdist_wheel_abi3(bdist_wheel):
def get_tag(self):
python, abi, plat = super().get_tag()
if python.startswith("cp"):
return "cp311", "abi3", plat
return python, abi, plat
cmdclass = {"cmdclass": {"bdist_wheel": bdist_wheel_abi3}}
define_macros += [("Py_LIMITED_API", 0x030B0000)]
py_limited_api = True
ext = Extension(
name="zengl",
sources=["zengl.c"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros,
py_limited_api=py_limited_api,
)
with open("README.md") as readme:
long_description = readme.read()
setup(
name="zengl",
version="2.3.0",
ext_modules=[ext],
py_modules=["_zengl", "_zengl_js"],
license="MIT",
python_requires=">=3.6",
platforms=["any"],
description="Self-Contained OpenGL Rendering Pipelines for Python",
long_description=long_description,
long_description_content_type="text/markdown",
author="Szabolcs Dombi",
author_email="szabolcs@szabolcsdombi.com",
url="https://github.com/szabolcsdombi/zengl/",
project_urls={
"Documentation": "https://zengl.readthedocs.io/",
"Source": "https://github.com/szabolcsdombi/zengl/",
"Bug Tracker": "https://github.com/szabolcsdombi/zengl/issues/",
},
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Topic :: Desktop Environment",
"Topic :: Games/Entertainment",
"Topic :: Multimedia",
"Topic :: Multimedia :: Graphics",
"Topic :: Multimedia :: Graphics :: 3D Rendering",
"Topic :: Multimedia :: Graphics :: Presentation",
"Topic :: Multimedia :: Graphics :: Viewers",
"Topic :: Multimedia :: Video :: Display",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Visualization",
"Environment :: GPU",
"Environment :: Web Environment",
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: Win32 (MS Windows)",
"Environment :: X11 Applications",
"Environment :: MacOS X",
"Typing :: Typed",
],
keywords=[
"OpenGL",
"rendering",
"graphics",
"visualization",
"3D",
"shader",
"geometry",
"accelerated",
"gpu",
"webgl",
],
**cmdclass,
**stubs,
)