2021-01-22 23:51:11 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
2021-01-23 09:52:45 +01:00
|
|
|
import platform
|
2021-01-22 23:51:11 +01:00
|
|
|
from setuptools import setup, Extension
|
2021-01-24 15:28:25 +01:00
|
|
|
|
2021-01-22 23:51:11 +01:00
|
|
|
|
2021-02-03 00:24:50 +01:00
|
|
|
extension_sources = ["cwcwidth/_impl.pyx"]
|
2021-02-07 22:54:12 +01:00
|
|
|
if platform.system() == "Windows":
|
2021-01-23 09:52:45 +01:00
|
|
|
extension_sources.append("cwcwidth/wcwidth.c")
|
|
|
|
|
define_macros = [
|
|
|
|
|
("USE_MK_WCWIDTH", None),
|
|
|
|
|
]
|
|
|
|
|
else:
|
|
|
|
|
define_macros = [
|
|
|
|
|
("_XOPEN_SOURCE", "600"),
|
|
|
|
|
]
|
|
|
|
|
|
2021-01-24 15:28:25 +01:00
|
|
|
ext_modules = [
|
|
|
|
|
Extension(
|
|
|
|
|
"cwcwidth._impl",
|
|
|
|
|
extension_sources,
|
|
|
|
|
define_macros=define_macros,
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
|
2021-01-22 23:51:11 +01:00
|
|
|
setup(
|
2021-01-24 15:28:25 +01:00
|
|
|
ext_modules=ext_modules,
|
2021-01-22 23:51:11 +01:00
|
|
|
packages=["cwcwidth"],
|
2021-01-27 00:44:56 +01:00
|
|
|
package_data={
|
2021-02-03 00:25:22 +01:00
|
|
|
"cwcwidth": ["_impl.pyi", "py.typed"],
|
2021-01-27 00:44:56 +01:00
|
|
|
},
|
2021-01-22 23:51:11 +01:00
|
|
|
)
|