forked from hjweide/pyastar2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
52 lines (43 loc) · 1.56 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
import setuptools
from distutils.core import Extension
from setuptools.command.build_ext import build_ext as _build_ext
# https://stackoverflow.com/a/21621689/
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:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
astar_module = Extension(
'pyastar.astar', sources=['src/cpp/astar.cpp'],
extra_compile_args=["-O3", "-Wall", "-shared", "-fpic"],
)
with open("requirements.txt", "r") as fh:
install_requires = fh.readlines()
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pyastar",
version="0.0.1",
author="Hendrik Weideman",
author_email="[email protected]",
description=(
"A simple implementation of the A* algorithm for "
"path-finding on a two-dimensional grid."),
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/hjweide/a-star",
cmdclass={"build_ext": build_ext},
setup_requires=["wheel", "numpy"],
install_requires=install_requires,
packages=setuptools.find_packages(where="src", exclude=("tests",)),
package_dir={"": "src"},
ext_modules=[astar_module],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)