-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
120 lines (107 loc) · 3.22 KB
/
setup.py
File metadata and controls
120 lines (107 loc) · 3.22 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import re
import sys
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize
if sys.platform == "win32":
extra_compile_args = ["/std:c++17"]
else:
extra_compile_args = ["-std=c++17"]
def sources(*files):
return [f"w9_pathfinding/src/{f}.cpp" for f in files]
include_dirs = ["w9_pathfinding/src/include"]
ext_modules = [
Extension(
name="w9_pathfinding.bindings.envs",
sources=[
"w9_pathfinding/bindings/envs.pyx",
*sources("env", "graph", "grid", "grid_3d", "hex_grid", "components"),
],
include_dirs=include_dirs,
language="c++",
extra_compile_args=extra_compile_args,
),
Extension(
name="w9_pathfinding.bindings.pf",
sources=[
"w9_pathfinding/bindings/pf.pyx",
*sources(
"env",
"dfs",
"bfs",
"bi_bfs",
"dijkstra",
"bi_dijkstra",
"a_star",
"bi_a_star",
"gbs",
"ida_star",
"resumable_search",
),
],
include_dirs=include_dirs,
language="c++",
extra_compile_args=extra_compile_args,
),
Extension(
name="w9_pathfinding.bindings.mapf",
sources=[
"w9_pathfinding/bindings/mapf.pyx",
*sources(
"env",
"mapf",
"reservation_table",
"resumable_search",
"resumable_space_time_dijkstra",
"space_time_a_star",
"hc_a_star",
"whc_a_star",
"cbs",
"icts",
"multi_agent_a_star",
),
],
include_dirs=include_dirs,
language="c++",
extra_compile_args=extra_compile_args,
),
]
def read_version():
with open("w9_pathfinding/__init__.py") as f:
match = re.search(r'__version__ = ["\'](.*)["\']', f.read())
if match:
return match.group(1)
raise RuntimeError("Unable to find version string.")
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
# Information
name="w9-pathfinding",
version=read_version(),
author="w9PcJLyb",
description="Implementation of some pathfinding algorithms",
url="https://github.com/w9PcJLyb/w9-pathfinding",
project_urls={
"Bug Tracker": "https://github.com/w9PcJLyb/w9-pathfinding/issues",
"Documentation": "https://w9-pathfinding.readthedocs.io/stable",
"Release Notes": "https://w9-pathfinding.readthedocs.io/stable/changelog.html",
},
license="Apache-2.0",
keywords="pathfinding mapf",
long_description=long_description,
long_description_content_type="text/markdown",
# Build instructions
ext_modules=cythonize(ext_modules, language_level="3", force=False),
packages=find_packages(),
install_requires=["setuptools", "cython"],
extras_require={
"dev": [
"pytest",
"pytest-subtests",
"twine",
"numpy",
"matplotlib",
"pydantic>=2.11.0",
],
},
python_requires=">=3.10",
)