forked from PyMySQL/PyMySQL
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathsetup.py
More file actions
29 lines (26 loc) · 1.02 KB
/
setup.py
File metadata and controls
29 lines (26 loc) · 1.02 KB
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
import sys
import os
from setuptools import setup, Extension
if os.environ.get('NO_CYTHON'):
ext_modules = None
else:
try:
from Cython.Build import cythonize
ext_modules = cythonize([
Extension("cymysql.packet", ["cymysql/packet.pyx"]),
Extension("cymysql.result", ["cymysql/result.pyx"]),
Extension("cymysql.socketwrapper", ["cymysql/socketwrapper.pyx"]),
Extension("cymysql.charset", ["cymysql/charset.py"]),
Extension("cymysql.converters", ["cymysql/converters.py"]),
Extension("cymysql.connections", ["cymysql/connections.py"]),
Extension("cymysql.cursors", ["cymysql/cursors.py"]),
Extension("cymysql.err", ["cymysql/err.py"]),
Extension("cymysql.times", ["cymysql/times.py"]),
],
compiler_directives={'language_level': str(sys.version_info[0])},
)
except ImportError:
ext_modules = None
setup(
ext_modules=ext_modules,
)