Address 20 findings from safety-critical review: CRITICAL: - C1: Replace ET.fromstring with defusedxml across all XML parsers - C2: Fix client init failure leaving half-initialized state; clean up HTTP client on startup failure so next connection can retry HIGH: - H1: Replace unbounded dicts with LRU caches (maxsize=500) - H2: Move Nominatim rate limiter from module globals to per-instance state on GIBSClient, eliminating shared mutable state - H3: Validate _parse_rgb input, return (0,0,0) on malformed data - H4: Add exponential backoff retry for capabilities loading - H5: Invert WMS error detection to verify image content-type - H6: Clamp image dimensions to 4096 max to prevent OOM MEDIUM: - M1: Convert images to RGB mode in compare_dates for RGBA safety - M2: Narrow DescribeDomains XML matching to TimeDomain elements - M3: Add BBox model_validator for coordinate range validation - M4: Add ET.ParseError to colormap fetch exception handling - M5: Replace bare except Exception with specific types in server - M6: Catch ValueError from _resolve_bbox in imagery tools for consistent error returns - M7: Only cache successful geocoding lookups (no negative caching) LOW: - L3: Derive USER_AGENT version from package __version__ - L5: Remove unused start_date/end_date params from check_layer_dates
52 lines
1.2 KiB
TOML
52 lines
1.2 KiB
TOML
[project]
|
|
name = "mcgibs"
|
|
version = "2026.02.18"
|
|
description = "FastMCP server for NASA Global Imagery Browse Services (GIBS)"
|
|
readme = "CLAUDE.md"
|
|
requires-python = ">=3.12"
|
|
authors = [{name = "Ryan Malloy", email = "ryan@supported.systems"}]
|
|
keywords = ["nasa", "gibs", "mcp", "satellite", "imagery", "earth-science"]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: Science/Research",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Programming Language :: Python :: 3.14",
|
|
"Topic :: Scientific/Engineering :: GIS",
|
|
]
|
|
dependencies = [
|
|
"fastmcp>=3.0.0",
|
|
"pillow>=12.0.0",
|
|
"defusedxml>=0.7.1",
|
|
]
|
|
|
|
[project.scripts]
|
|
mcgibs = "mcgibs.server:main"
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"ruff>=0.9.0",
|
|
"pytest>=8.0.0",
|
|
"pytest-asyncio>=1.0.0",
|
|
"respx>=0.22.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/mcgibs"]
|
|
|
|
[tool.ruff]
|
|
target-version = "py312"
|
|
line-length = 99
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|