-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
284 lines (254 loc) · 7.15 KB
/
pyproject.toml
File metadata and controls
284 lines (254 loc) · 7.15 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "allocator"
dynamic = ["version"]
description = "Modern Python package for geographic task allocation, clustering, and routing optimization"
readme = "README.md"
requires-python = ">=3.11"
license = "MIT"
authors = [
{name = "Suriyan Laohaprapanon", email = "suriyant@gmail.com"},
{name = "Gaurav Sood", email = "gsood07@gmail.com"},
]
maintainers = [
{name = "Gaurav Sood", email = "gsood07@gmail.com"},
]
keywords = [
"geographic", "allocation", "clustering", "routing", "optimization",
"tsp", "kmeans", "geospatial", "logistics", "shortest-path"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Typing :: Typed",
]
dependencies = [
# Core data processing
"pandas>=2.0.0",
"numpy>=1.24.0",
# JIT compilation for performance
"numba>=0.58.0",
# Machine learning algorithms
"scikit-learn>=1.3.0",
# Scientific computing (for simulation)
"scipy>=1.10.0",
# Distance calculations
"utm>=0.7.0",
"haversine>=2.8.0",
# Graph operations
"networkx>=3.0",
# CLI interface
"click>=8.0.0",
"rich>=13.0.0",
# HTTP requests (for OSRM)
"requests>=2.28.0",
# Google Maps API
"googlemaps>=4.6.0",
"google-maps-routing>=0.6.0",
# Optimization algorithms
"ortools>=9.5.0",
# Visualization (basic)
"matplotlib>=3.6.0",
"seaborn>=0.13.2",
]
[project.optional-dependencies]
# Algorithm-specific dependencies
algorithms = [
"Christofides>=1.0.0",
]
geo = [
"folium>=0.14.0", # Interactive maps
"polyline>=2.0.0", # Route encoding
]
# graph = [
# "kahipwrapper>=0.1.0", # KaHIP graph partitioning (if available)
# ]
# Development dependencies
dev = [
"ruff>=0.1.0", # Modern linting and formatting
"mypy>=1.5.0", # Type checking
"black>=23.0.0", # Code formatting
"isort>=5.12.0", # Import sorting
"pre-commit>=3.0.0", # Git hooks
]
test = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0", # Parallel testing
"coverage>=7.2.0",
"hypothesis>=6.82.0", # Property-based testing
]
docs = [
"sphinx>=7.0.0",
"furo>=2023.9.10", # Modern Sphinx theme
"myst-parser>=2.0.0", # Markdown support
"linkify-it-py>=2.0.0", # Required for MyST linkify extension
"sphinx-autodoc-typehints>=1.24.0",
"sphinx-design>=0.5.0", # Modern design components
]
# Convenience groups
all = [
"allocator[algorithms,geo]",
]
complete = [
"allocator[all,dev,test,docs]",
]
[project.urls]
Homepage = "https://github.com/geosensing/allocator"
Documentation = "https://geosensing.github.io/allocator/"
Repository = "https://github.com/geosensing/allocator.git"
"Bug Reports" = "https://github.com/geosensing/allocator/issues"
"Source Code" = "https://github.com/geosensing/allocator"
Changelog = "https://github.com/geosensing/allocator/blob/main/CHANGELOG.md"
[project.scripts]
allocator = "allocator.cli.main:cli"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
[tool.coverage.run]
source = ["allocator"]
omit = ["*/tests/*", "*/test_*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
# Ruff configuration - Modern Python linter and formatter
[tool.ruff]
target-version = "py311"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
]
[tool.ruff.lint.per-file-ignores]
"allocator/__init__.py" = ["E402", "RUF022"]
[tool.ruff.lint.isort]
known-first-party = ["allocator"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# Black configuration
[tool.black]
line-length = 100
target-version = ['py311', 'py312', 'py313']
skip-string-normalization = false
# isort configuration
[tool.isort]
profile = "black"
line_length = 100
multi_line_output = 3
known_first_party = ["allocator"]
# mypy configuration
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
[[tool.mypy.overrides]]
module = [
"utm.*",
"haversine.*",
"networkx.*",
"matplotlib.*",
"folium.*",
"googlemaps.*",
"google.maps.*",
"ortools.*",
"polyline.*",
"sklearn.*",
"scipy.*",
"Christofides.*",
"seaborn.*",
"numba.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "allocator.vulture_whitelist"
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"allocator.distances.factory",
"allocator.distances.euclidean",
"allocator.distances.haversine",
"allocator.core.routing",
"allocator.core.itinerary",
"allocator.api.*",
"allocator.cli.*",
]
disallow_untyped_defs = false
disallow_untyped_decorators = false
warn_return_any = false
warn_unreachable = false
check_untyped_defs = false
disallow_incomplete_defs = false
[[tool.mypy.overrides]]
module = [
"allocator.distances.external_apis",
"allocator.viz.plotting",
]
ignore_errors = true
# Deptry configuration
[tool.deptry]
extend_exclude = ["tests/", "benchmarks/", "examples/"]
optional_dependencies_dev_groups = ["dev", "test", "docs"]
[tool.deptry.per_rule_ignores]
DEP001 = ["Christofides"]
DEP002 = ["Christofides", "seaborn", "allocator", "scipy"]
[tool.deptry.package_module_name_map]
Christofides = "christofides"
linkify-it-py = "linkify_it_py"
# Vulture configuration (dead code detection)
[tool.vulture]
min_confidence = 80
paths = ["allocator", "allocator/vulture_whitelist.py"]
exclude = ["tests/"]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "allocator/_version.py"
[dependency-groups]
dev = ["pytest>=7.0", "pytest-cov>=4.0", "ruff>=0.7.0", "mypy>=1.0", "deptry>=0.12.0", "vulture>=2.10"]
test = ["pytest>=7.0", "pytest-cov>=4.0"]