-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
67 lines (59 loc) · 1.94 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import sys
from setuptools import setup, Extension
try:
from Cython.Build import cythonize
extension_source = "tfrecord_lite.pyx"
except ImportError:
def cythonize(extension):
return [extension]
extension_source = "tfrecord_lite.cpp"
extra_compile_args=[]
extra_link_args=[]
if "linux" in sys.platform or "darwin" in sys.platform:
extra_compile_args += ["-O3", "-Wall", "-std=c++11"]
if "darwin" in sys.platform:
extra_compile_args += ["-mmacosx-version-min=10.9"]
extra_link_args=["-stdlib=libc++", "-mmacosx-version-min=10.9"]
setup(
name="tfrecord_lite",
version="0.0.8",
description="A lightweight tfrecord parser",
url="https://github.com/jongwook/tfrecord_lite",
author="Jong Wook Kim",
author_email="[email protected]",
license="MIT",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
keywords="tfrecord",
project_urls={
"Source": "https://github.com/jongwook/tfrecord_lite",
"Tracker": "https://github.com/jongwook/tfrecord_lite/issues"
},
install_requires=["numpy"],
python_requires=">=3.6",
package_data={
"tfrecord_lite": ["src/*", "tfrecrod_lite.pyx", "tfrecrod_lite.cpp"]
},
ext_modules=cythonize(Extension(
"tfrecord_lite",
sources=[
extension_source,
"src/tfrecord_lite.cpp",
"src/example.pb.cpp",
"src/feature.pb.cpp",
"src/pb_common.cpp",
"src/pb_decode.cpp",
"src/pb_encode.cpp"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
language="c++",
include_dirs=["src/"]
))
)