-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
50 lines (46 loc) · 1.95 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
from setuptools import setup, Extension
import os
import platform
root_dir = os.path.dirname(os.path.realpath(__file__))
src_dir = os.path.join(root_dir, "lemmagen/lib/src")
include_dir = os.path.join(root_dir, "lemmagen/lib/include")
# Setup compilation arguments for native code
compile_args = []
link_args = []
if os.name == 'posix':
compile_args = ["-O3", "-ffunction-sections", "-fdata-sections", "-fvisibility-inlines-hidden"]
if platform.system() == 'Darwin':
link_args = ["-Wl,-dead_strip"]
else:
compile_args.append("-std=c++11")
link_args = ["-Wl,-z,noexecstack", "-Wl,-z,now", "-Wl,-z,relro", "-Wl,--gc-sections"]
elif os.name == 'nt':
compile_args = ["/Ox", "/EHsc"]
link_args = []
lib = Extension('lemmagen.libLemmagen',
["lemmagen/libLemmagen.pyx", os.path.join(src_dir, "lemmagen.cpp"), os.path.join(src_dir, "RdrLemmatizer.cpp")],
extra_compile_args=compile_args,
extra_link_args=link_args,
include_dirs=[include_dir])
setup(name="Lemmagen",
version="1.3.2",
description="LemmaGen lemmatizer for Python supporing Slovene, Serbian, Romanian, Estonian, Bulgarian and other languages",
package_data={'lemmagen':["lib/data/*"]},
license="GPLv2+",
author="Jernej Virag",
author_email="[email protected]",
setup_requires = ["setuptools>=18.0","cython>=0.28.4"],
classifiers=[
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Text Processing :: Linguistic",
],
ext_modules=[lib],
test_suite="tests",
packages=["lemmagen"])