-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
86 lines (77 loc) · 3.04 KB
/
Copy pathpyproject.toml
File metadata and controls
86 lines (77 loc) · 3.04 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "structura-workflow"
version = "0.4.1"
description = "AI-assisted vectorisation of photogrammetric excavation data into georeferenced vectors for a PostGIS excavation database."
readme = "README.md"
requires-python = ">=3.11"
license = { text = "AGPL-3.0-or-later" }
authors = [{ name = "Patrick Leiverkus", email = "patrick.leiverkus@uni-oldenburg.de" }]
# Core deps kept light; heavy/optional model + geo stacks live in extras below.
dependencies = [
"numpy>=1.26",
]
[project.optional-dependencies]
# Raster I/O, georeferencing, raster->vector, topology
geo = [
"rasterio>=1.3",
"shapely>=2.0",
"geopandas>=0.14",
"scikit-image>=0.22",
"pyogrio>=0.7",
]
# 2D segmentation backends
sam = ["segment-geospatial"] # samgeo — wraps SAM + checkpoint download + tiling
cellpose = ["cellpose>=4"] # Cellpose v4 (Cellpose-SAM / cpsam)
# Database sinks
db = ["psycopg[binary]>=3.1", "SQLAlchemy>=2.0", "GeoAlchemy2>=0.14"]
# Django-API sink
api = ["httpx>=0.27"]
# ruff is pinned exactly: it is a linter, and its rule set changes between
# releases (0.16.0 enabled RUF100 by default, which turned CI red on an
# unchanged tree). Bumping it should be a visible, deliberate commit.
dev = ["pytest>=8", "ruff==0.16.0", "mypy>=1.10"]
[project.scripts]
structura = "structura.cli:main"
[tool.hatch.build.targets.wheel]
packages = ["src/structura"]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
# Ruff's defaults (E4, E7, E9, F) plus two rules this project depends on:
# PLC0415 — lazy imports are a deliberate architectural choice (the package
# must import without the optional geo / model extras, and `--help` must not
# pull in the heavy stacks). Enabling the rule means each one is marked
# explicitly instead of being indistinguishable from an accidental import.
# RUF100 — flag `noqa` directives that have stopped suppressing anything.
# Selecting explicitly also pins the *rule set*, so a future ruff release cannot
# silently widen it; the version itself is pinned in the `dev` extra.
select = ["E4", "E7", "E9", "F", "PLC0415", "RUF100"]
[tool.mypy]
# Deliberately no `python_version` pin: CI type-checks under both 3.11 and 3.12,
# and each job should analyse its own interpreter. Hard-coding 3.11 made the 3.12
# job parse its own dependencies against an older grammar — numpy 2.5 (3.12-only;
# 3.11 resolves to 2.4) ships PEP 695 `type` statements, which mypy then rejected
# as a syntax error. That is a toolchain artefact, not a defect in this code.
ignore_missing_imports = true
# Don't follow into the geospatial / imaging stacks — they are untyped for our
# purposes and some (e.g. tifffile) use syntax newer than the interpreter being
# analysed. Treat them as Any.
[[tool.mypy.overrides]]
module = [
"rasterio.*",
"shapely.*",
"geopandas.*",
"skimage.*",
"pyogrio.*",
"tifffile.*",
"samgeo.*",
"cellpose.*",
"torch.*",
"cv2.*",
]
follow_imports = "skip"
ignore_missing_imports = true