forked from Skielex/thinmaxflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (53 loc) · 1.93 KB
/
setup.py
File metadata and controls
66 lines (53 loc) · 1.93 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
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
from setuptools import setup, Extension
with open("README.md", "r") as fh:
long_description = fh.read()
class LazyCythonize(list):
def __init__(self, callback):
self._list, self.callback = None, callback
def c_list(self):
if self._list is None:
self._list = self.callback()
return self._list
def __iter__(self):
for e in self.c_list():
yield e
def __getitem__(self, ii): return self.c_list()[ii]
def __len__(self): return len(self.c_list())
def extensions():
from Cython.Build import cythonize
maxflow_module = Extension(
"thinmaxflow._maxflow",
[
"thinmaxflow/src/_maxflow.pyx",
"thinmaxflow/src/core/maxflow.cpp",
"thinmaxflow/src/core/graph.cpp",
],
language="c++",
)
return cythonize([maxflow_module])
setup(name="thinmaxflow",
version="0.1.4",
author="Niels Jeppesen",
author_email="niejep@dtu.dk",
description="A thin Maxflow wrapper for Python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Skielex/thinmaxflow",
packages=["thinmaxflow"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: C++",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Mathematics"
],
ext_modules=LazyCythonize(extensions),
setup_requires=["Cython"]
)