-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
93 lines (76 loc) · 2.46 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import io
import os
from setuptools import setup, find_packages
from setuptools.extension import Extension
import numpy as np
# https://stackoverflow.com/questions/4505747/
# how-should-i-structure-a-python-package-that-contains-cython-code
# https://stackoverflow.com/questions/14657375/
# cython-fatal-error-numpy-arrayobject-h-no-such-file-or-directory
# https://github.com/cython/cython/issues/1480
# https://stackoverflow.com/questions/14372706/
# visual-studio-cant-build-due-to-rc-exe
EXT_MODULES = []
try:
from Cython.Build import cythonize
import Cython.Compiler.Options
Cython.Compiler.Options.annotate = True
EXT_MODULES += cythonize(Extension(
"inpoly.inpoly_",
sources=[os.path.join("inpoly", "inpoly_.pyx")],
include_dirs=[np.get_include()]),
annotate=True
)
except ImportError:
EXT_MODULES += [Extension(
"inpoly.inpoly_",
sources=[os.path.join("inpoly", "inpoly_.c")],
include_dirs=[np.get_include()])
]
NAME = "inpoly"
DESCRIPTION = "Fast point(s)-in-polygon queries."
AUTHOR = "Darren Engwirda and Keith Roberts"
AUTHOR_EMAIL = "[email protected]"
URL = "https://github.com/dengwirda/inpoly-python"
VERSION = "0.2.2"
REQUIRES_PYTHON = ">=3.3.0"
KEYWORDS = "Point-in-Polygon Geometry GIS"
REQUIRED = [
"numpy"
]
CLASSIFY = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Scientific/Engineering :: GIS"
]
HERE = os.path.abspath(os.path.dirname(__file__))
try:
with io.open(os.path.join(
HERE, "README.md"), encoding="utf-8") as f:
LONG_DESCRIPTION = "\n" + f.read()
except FileNotFoundError:
LONG_DESCRIPTION = DESCRIPTION
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
license="custom",
author=AUTHOR,
author_email=AUTHOR_EMAIL,
python_requires=REQUIRES_PYTHON,
keywords=KEYWORDS,
url=URL,
packages=find_packages(exclude=["msh", ]), # just inpoly
ext_modules=EXT_MODULES,
install_requires=REQUIRED,
classifiers=CLASSIFY
)