-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
79 lines (70 loc) · 2.07 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
import os
import re
import sys
import sysconfig
from setuptools import Extension, setup
extra_compile_args = []
extra_link_args = []
define_macros = []
if sys.platform.startswith('darwin'):
extra_compile_args += ['-Wno-writable-strings']
if os.getenv('PYODIDE') or str(sysconfig.get_config_var('HOST_GNU_TYPE')).startswith('wasm'):
with open('zengl.js') as zengl_js:
code = re.sub(r'\s+', ' ', zengl_js.read())
define_macros += [('EXTERN_GL', f'"{code}"')]
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',
]
ext = Extension(
name='zengl',
sources=['zengl.c'],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros,
)
with open('README.md') as readme:
long_description = readme.read()
setup(
name='zengl',
version='2.7.1',
ext_modules=[ext],
py_modules=['_zengl'],
license='MIT',
platforms=['any'],
description='OpenGL Pipelines for Python',
long_description=long_description,
long_description_content_type='text/markdown',
author='Szabolcs Dombi',
author_email='[email protected]',
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/',
},
keywords=[
'OpenGL',
'rendering',
'graphics',
'shader',
'gpu',
],
packages=['zengl-stubs'],
package_data={'zengl-stubs': ['__init__.pyi']},
include_package_data=True,
)