-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
67 lines (58 loc) · 2.1 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
# -*- coding: utf-8 -*-
import os
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
root_dir = os.path.abspath(os.path.dirname(__file__))
readme_file = os.path.join(root_dir, "README.rst")
with open(readme_file, encoding="utf-8") as f:
long_description = f.read()
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
try:
__builtins__.__NUMPY_SETUP__ = False
except:
try:
# For python 3
import builtins
builtins.__NUMPY_SETUP__ = False
except:
warn("Skipping numpy hack; if installation fails, try installing numpy first")
import numpy
self.include_dirs.append(numpy.get_include())
setup(
name="pysupercluster",
version="0.7.8",
description="A fast geospatial point clustering module.",
long_description=long_description,
author="Jeremy Lainé",
author_email="[email protected]",
url="https://github.com/wemap/pysupercluster",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: ISC License (ISCL)",
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: GIS",
],
cmdclass={"build_ext": build_ext},
install_requires=["numpy"],
python_requires=">=3",
setup_requires=["numpy"],
ext_modules=[
Extension(
"pysupercluster",
extra_compile_args=["-std=c++1y"],
language="c++",
depends=["src/kdbush.hpp", "src/supercluster.hpp",],
sources=["src/module.cpp", "src/supercluster.cpp",],
)
],
)