-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
24 lines (17 loc) · 703 Bytes
/
setup.py
File metadata and controls
24 lines (17 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# SPDX-License-Identifier: MIT
import os
import platform
from setuptools import setup, Extension
DEBUG=(os.getenv('DEBUG') or '').strip().lower() in ['1', 'y', 'true']
MSVC=(platform.platform().startswith('Windows') and
platform.python_compiler().startswith('MS'))
COMPILE_ARGS=[] if MSVC else (["-g", "-O0", "-UNDEBUG"] if DEBUG else ["-O3"])
def uwcwidth_ext(module, pyx_file):
return Extension(module,
sources=[pyx_file],
extra_compile_args=COMPILE_ARGS)
setup(
name='uwcwidth',
ext_modules=[uwcwidth_ext("uwcwidth.uwcwidth", "uwcwidth/uwcwidth.pyx")],
package_data={'uwcwidth': ['__init__.pxd', 'uwcwidth.pxd', 'tables.pxd']}
)