-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
39 lines (34 loc) · 1022 Bytes
/
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
import sys
import os
from setuptools import Extension, setup
from Cython.Build import cythonize
vi = sys.version_info
if vi < (3, 8):
raise RuntimeError('picows requires Python 3.8 or greater')
if os.name == 'nt':
libraries = ["Ws2_32"]
else:
libraries = None
cython_modules = [
Extension("picows.picows", ["picows/picows.pyx"], libraries=libraries)
]
if os.getenv("PICOWS_BUILD_EXAMPLES") is not None:
cython_modules.append(Extension("examples.echo_client_cython", ["examples/echo_client_cython.pyx"]))
setup(
ext_modules=cythonize(
cython_modules,
compiler_directives={
'language_level': sys.version_info[0],
'profile': False,
'nonecheck': False,
'boundscheck': False,
'wraparound': False,
'initializedcheck': False,
'optimize.use_switch': False,
'cdivision': True
},
annotate=True,
gdb_debug=False
),
package_data={"picows": ["py.typed"]},
)