-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
185 lines (166 loc) · 5.39 KB
/
Copy pathpyproject.toml
File metadata and controls
185 lines (166 loc) · 5.39 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "socialmapper"
version = "1.1.2"
description = "A Python library for spatial analysis, demographic mapping, and geospatial data processing with a modern API"
readme = "README.md"
requires-python = ">=3.11,<3.14"
license = {file = "LICENSE"}
authors = [
{name = "mihiarc", email = "mihiarc@example.com"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: GIS",
]
keywords = ["gis", "mapping", "demographics", "census", "OpenStreetMap"]
dependencies = [
"geopandas>=0.14.0",
"pandas>=2.0.0",
"numpy>=1.24.0",
"requests>=2.28.0",
"shapely>=2.0.0",
"pyogrio>=0.7.0", # Implicit geopandas I/O backend
"pyarrow>=12.0.0", # Implicit parquet backend for data files
"pyproj>=3.6.0",
"pydantic>=2.0.0",
"rich>=13.0.0",
"matplotlib>=3.7.0",
"contextily>=1.4.0",
"diskcache>=5.6.0",
"routingpy>=1.3.0",
"geopy>=2.4.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.4.1",
"ty>=0.0.1a10",
"ruff>=0.12.0",
"mkdocs>=1.6.1",
"mkdocs-material-extensions>=1.3.1",
"build>=1.3.0",
"twine>=6.1.0",
]
interactive = [
"folium>=0.17.0", # Interactive Leaflet maps for HTML export
]
[project.urls]
"Homepage" = "https://github.com/mihiarc/socialmapper"
"Bug Tracker" = "https://github.com/mihiarc/socialmapper/issues"
# Use Python API:
# from socialmapper import SocialMapper, quick_analysis
[tool.hatch.build.targets.wheel]
packages = ["socialmapper"]
include = [
"socialmapper/data/neighbors/*.parquet",
]
[tool.hatch.build.targets.wheel.shared-data]
"socialmapper/data" = "socialmapper/data"
[tool.ruff]
line-length = 100
target-version = "py311"
fix = true
[tool.ruff.lint]
# Enable comprehensive rule sets for 2025 best practices
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort (import sorting)
"N", # pep8-naming
"D", # pydocstyle (docstring conventions)
"UP", # pyupgrade (modernize Python syntax)
"B", # flake8-bugbear (common bugs)
"C4", # flake8-comprehensions (list/dict comprehensions)
"PIE", # flake8-pie (misc best practices)
"PL", # Pylint
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"TCH", # flake8-type-checking (type import optimization)
"PTH", # flake8-use-pathlib (prefer pathlib over os.path)
"FURB", # refurb (modernize code patterns)
"PERF", # Perflint (performance anti-patterns)
"LOG", # flake8-logging (logging best practices)
]
ignore = [
"E501", # Line too long - handled by formatter
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D107", # Missing docstring in __init__
"PLR0913", # Too many arguments to function call
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"B008", # Do not perform function calls in argument defaults (common in FastAPI/typer)
]
# Modern pydocstyle configuration
[tool.ruff.lint.pydocstyle]
convention = "numpy"
# Per-file ignores for common patterns
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403", "E402"] # Allow unused imports and import ordering in __init__.py
"tests/*" = ["D", "PLR2004", "S101"] # Disable docstring and assert rules in tests
"examples/*" = ["D", "T201"] # Allow print statements in examples
"scripts/*" = ["D", "T201"] # Allow print statements in scripts
# Import sorting configuration (replaces isort)
[tool.ruff.lint.isort]
known-first-party = ["socialmapper"]
force-single-line = false
split-on-trailing-comma = true
# Modern formatting configuration (replaces Black)
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = 80
[tool.pytest.ini_options]
markers = [
"integration: marks tests as integration tests (slower, may use external resources)",
"slow: marks tests as slow running (may take several seconds)",
"benchmark: marks tests that measure performance benchmarks",
"external: marks tests that require external services (network, APIs)",
]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"-ra",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"ignore::FutureWarning:pandas.*",
"ignore::UserWarning:geopandas.*",
]
[tool.coverage.run]
source = ["socialmapper"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/.venv/*",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
[tool.coverage.html]
directory = "reports/htmlcov"
[tool.coverage.json]
output = "reports/coverage.json"
# ty configuration (ultra-fast Rust-based type checker)
# Note: ty is pre-alpha and configuration is minimal
# Most configuration is done via command-line flags