-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
145 lines (138 loc) · 8.38 KB
/
Copy pathpyproject.toml
File metadata and controls
145 lines (138 loc) · 8.38 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
# Workspace root -- individual packages live under packages/.
# This file configures shared dev tooling only and is intentionally NOT
# installable: it declares no [build-system] or [project] block, so
# `pip install .` at the repo root is a no-op (and `pip install -e .`
# raises rather than building a stub distribution). To install the SDKs,
# use the per-package directories under ``packages/`` instead, e.g.::
#
# pip install ./packages/honua-sdk
# pip install ./packages/honua-admin
#
# Tooling (ruff, mypy, pytest, coverage) still discovers configuration
# from this file because PEP 518 / per-tool conventions resolve
# ``[tool.*]`` tables without requiring a build-system table.
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"integration: tests that exercise a real Honua deployment",
"staging: tests intended for the staging smoke lane",
"smoke: lightweight release and CI smoke coverage",
"conformance: shared geospatial-grpc fixtures checked against a pinned live server",
]
[tool.ruff]
line-length = 120
target-version = "py311"
extend-exclude = [
"packages/honua-sdk/honua_sdk/grpc/_generated",
# honua-gp is a separately-developed package; it is linted under its
# own (lenient) gate rather than this workspace-root strict rule set.
"packages/honua-gp",
# honua-arcpy is a deprecated backward-compat shim that only re-exports
# honua-gp; it is excluded from the strict workspace lint gate.
"packages/honua-arcpy",
]
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM", "RUF", "TID", "PL", "S"]
# Global ignores intentionally empty: E501, PLR0913, and PLR2004 are now
# scoped via per-file-ignores so new modules are held to the strict bar.
# UP037/UP017/PLC0415/I001/E402/F401/E741/SIM10x/PLR091x remain scoped
# per-file as we ratchet enforcement up incrementally.
ignore = []
[tool.ruff.lint.per-file-ignores]
# Tests, examples, and scripts: argument-count and magic-value rules don't
# usefully apply to fixtures, demos, or one-shot scripts. Long lines are
# also routine inside fixture data.
"tests/**" = ["E501", "PLR0913", "PLR2004", "SIM", "B017", "PLC0415", "I001", "UP037", "UP017", "F401", "E402", "E741", "PLR0911", "PLR0915", "PLR0912", "RUF022", "RUF043", "PLW0108", "PLR5501", "S101", "S105", "S106"]
"examples/**" = ["E501", "PLR0913", "PLR2004", "PLC0415", "I001", "UP037", "UP017", "F401", "E402", "E741", "PLR0911", "PLR0915", "PLR0912", "RUF022", "RUF043", "PLW0108", "PLR5501", "SIM108", "SIM105", "S105", "S106"]
"scripts/**" = ["E501", "PLR0913", "PLR2004", "PLC0415", "I001", "UP037", "UP017", "F401", "E402", "E741", "PLR0911", "PLR0915", "PLR0912", "RUF022", "RUF043", "RUF100", "PLW0108", "PLR5501", "SIM108", "SIM105", "S101", "S603", "S607"]
# Jupytext py:percent notebook mirrors render display cells as bare trailing
# expressions (B018), which is the intended notebook idiom, not dead code.
"examples/notebooks/*.py" = ["B018"]
# Narrow per-file allowances for runtime-import patterns inside the packages.
# PLC0415: deliberate lazy imports to avoid hard deps (geopandas, grpc) or to break import cycles.
# E501: wide public protocol surfaces use multi-keyword signatures where wrapping
# would hurt readability. PLR0913: same reason — public protocol APIs forward
# many optional pagination/filter knobs. PLR2004: HTTP status-code comparisons
# (400/404/429) are inherently magic numbers tied to the protocol, not constants.
# Per-file ignores have been narrowed so each file only excludes the rules it
# actually triggers — new rule families surface immediately in CI.
"packages/honua-sdk/honua_sdk/client.py" = ["PLC0415", "PLR0913", "PLR2004"]
"packages/honua-sdk/honua_sdk/async_client.py" = ["PLC0415", "PLR0913", "PLR2004"]
"packages/honua-sdk/honua_sdk/ogc.py" = ["PLR0913"]
# _client_protocol.py mirrors the client's wide request signatures in a typed
# Protocol, so it forwards the same many optional knobs (PLR0913).
"packages/honua-sdk/honua_sdk/_client_protocol.py" = ["PLR0913"]
"packages/honua-sdk/honua_sdk/migration/arcpy.py" = ["E501", "PLR2004"]
# _cli.py imports HonuaClient lazily inside the `run` subcommand so the
# offline scan/translate/pyt commands work without httpx wired up.
"packages/honua-sdk/honua_sdk/migration/_cli.py" = ["PLC0415"]
"packages/honua-sdk/honua_sdk/source.py" = ["E501", "PLC0415"]
"packages/honua-sdk/honua_sdk/models.py" = ["E501"]
# cursors.py: the UpdateCursor constructors forward the same many optional
# query knobs (fields/where/geometry_filter/batch_size/...) as the Source query
# surface (PLR0913), matching the public-API rationale above.
"packages/honua-sdk/honua_sdk/cursors.py" = ["PLR0913"]
# _geometry.py imports shapely lazily so it stays an optional dependency
# (PLC0415): the pure-dict ``__geo_interface__`` path needs no third-party dep.
"packages/honua-sdk/honua_sdk/models/_geometry.py" = ["PLC0415"]
"packages/honua-sdk/honua_sdk/_http.py" = ["PLR2004"]
"packages/honua-sdk/honua_sdk/diagnostics.py" = ["PLR0912", "PLR0913"]
"packages/honua-sdk/honua_sdk/_query.py" = ["PLR0913", "PLR2004"]
# models/_query.py: Result.to_geodataframe lazily imports the geopandas bridge
# so geopandas stays an optional dependency (PLC0415).
"packages/honua-sdk/honua_sdk/models/_query.py" = ["PLC0415"]
"packages/honua-sdk/honua_sdk/_retry.py" = ["PLR0913"]
"packages/honua-sdk/honua_sdk/_async_retry.py" = ["PLR0913"]
"packages/honua-sdk/honua_sdk/geocoding.py" = ["PLR0913", "PLR2004"]
"packages/honua-sdk/honua_sdk/async_geocoding.py" = ["PLR0913", "PLR2004"]
"packages/honua-sdk/honua_sdk/geopandas.py" = ["PLC0415"]
"packages/honua-sdk/honua_sdk/geoprocessing.py" = ["PLC0415", "PLR0913"]
"packages/honua-sdk/honua_sdk/workflow.py" = ["PLR0913"]
"packages/honua-sdk/honua_sdk/grpc/_client.py" = ["PLC0415", "PLR0913"]
"packages/honua-sdk/honua_sdk/grpc/_proto_adapter.py" = ["PLC0415", "PLR2004"]
"packages/honua-admin/honua_admin/_client.py" = ["PLC0415", "PLR0913", "PLR2004"]
"packages/honua-admin/honua_admin/_async_client.py" = ["PLC0415", "PLR0913", "PLR2004"]
"packages/honua-admin/honua_admin/_models.py" = ["PLR2004"]
# _arcpy_scanner.py is an AST-walking inventory scanner: visitor methods use
# the ast node-class CamelCase names (N802), and the classifier has inherently
# many branches/returns and protocol-numeric comparisons.
"packages/honua-admin/honua_admin/_arcpy_scanner.py" = ["N802", "PLR0911", "PLR0912", "PLR0913", "PLR2004"]
# UP037: keep quoted forward refs in package source. The compatibility-gate snapshot
# captures inspect.signature output, which renders quoted annotations differently
# from bare references even with `from __future__ import annotations`. Stripping
# quotes would silently drift the public-api snapshot.
"packages/**" = ["UP037"]
[tool.mypy]
python_version = "3.11"
# Full mypy strict mode. The package reached parity with every individual
# strict ratchet (disallow_untyped_defs/calls, disallow_any_generics,
# warn_return_any, warn_unused_ignores, …) over the grading sweep; the final
# queued flags (warn_no_return, disallow_subclassing_any, strict_equality,
# no_implicit_reexport, disallow_incomplete_defs, extra_checks) were verified
# clean across all 53 source files, so `strict` is now the single source of
# truth instead of an open-coded flag list that can silently drift behind it.
strict = true
warn_unused_configs = true
ignore_missing_imports = true
packages = ["honua_sdk", "honua_admin"]
# Generated protobuf shims are untyped upstream; exempt them from the strict
# ratchets so we do not regenerate code just to add annotations (or suppress
# protobuf's ``Message``/``EnumTypeWrapper`` ``Any`` bases) that the next
# codegen run would erase. ``disallow_subclassing_any`` is the flag strict mode
# newly enforces against these generated ``*_pb2.pyi`` stubs.
[[tool.mypy.overrides]]
module = "honua_sdk.grpc._generated.*"
disallow_untyped_defs = false
disallow_untyped_calls = false
disallow_any_generics = false
disallow_subclassing_any = false
# Optional raster-interop extra (``honua-sdk[raster]``): rasterio/rioxarray/
# xarray and their transitive numpy stack are heavy third-party deps used only
# behind the optional ``honua_sdk.raster`` module. Treat them as untyped (Any)
# rather than following their published stubs — numpy's stubs use 3.12-only
# ``type`` statements that mypy's pinned 3.11 target cannot parse, and the
# raster module already degrades gracefully when the extra is absent.
[[tool.mypy.overrides]]
module = ["rasterio.*", "rioxarray.*", "xarray.*"]
follow_imports = "skip"
ignore_missing_imports = true