-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (195 loc) · 7.74 KB
/
pyproject.toml
File metadata and controls
222 lines (195 loc) · 7.74 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
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools-scm[toml]>=6.2", "setuptools>=64", "wheel"]
[project]
dynamic = ["version"]
name = "ocr"
requires-python = ">= 3.13"
# All runtime dependencies are managed by Pixi via conda-forge.
# for conda/pixi users this section is intentionally empty.
dependencies = ["topozarr>=0.0.4"]
[project.scripts]
ocr = "ocr.deploy.cli:app"
ocr-deploy = "ocr.deploy.cli:app"
[tool.setuptools.packages.find]
include = ["ocr*"]
[tool.setuptools.package-data]
ocr = ["data/*.json"]
[tool.setuptools_scm]
fallback_version = "999"
local_scheme = "node-and-date"
version_scheme = "post-release"
[tool.coverage.run]
branch = true
omit = ["tests/*"]
[tool.ruff]
builtins = ["ellipsis"]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
extend-include = ["*.ipynb"]
line-length = 100
target-version = "py313"
[tool.ruff.lint]
ignore = [
"E501", # Conflicts with ruff format
"E721", # Comparing types instead of isinstance
"E741", # Ambiguous variable names
]
per-file-ignores = {}
select = ["E", "F", "I", "UP", "W"]
[tool.ruff.lint.mccabe]
max-complexity = 18
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = []
[tool.ruff.format]
docstring-code-format = true
quote-style = "single"
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.pytest.ini_options]
addopts = [
"--cov-report=term-missing",
"--cov-report=xml",
"--cov=./ocr",
"--verbose",
]
console_output_style = "count"
markers = [
"integration: marks tests that require external resources or complex setups",
"unit: marks tests that are fast and isolated from external systems",
]
[tool.uv.sources]
ocr = { workspace = true }
[tool.pixi.workspace]
channels = ["conda-forge"]
name = "ocr"
platforms = ["linux-64", "linux-aarch64", "osx-arm64"]
# Only keep local package as an editable PyPI dep (and rare stragglers).
[tool.pixi.pypi-dependencies]
ocr = { path = ".", editable = true }
[tool.pixi.environments]
# Map environments to features
all-deps = ["coiled-deploy", "data-mgmt", "dev", "docs"]
default = ["coiled-deploy", "data-mgmt", "dev"]
deploy = ["coiled-deploy"]
dev = ["coiled-deploy", "data-mgmt", "dev"]
docs = ["coiled-deploy", "docs"]
# Tasks grouped by features
[tool.pixi.feature.dev.tasks]
format = { cmd = "ruff format" }
lint = { cmd = "pre-commit run --all-files" }
run-ruff-check = { cmd = "ruff check" }
tests = { cmd = "pytest -m 'not integration'" }
tests-integration = { cmd = "pytest -m 'integration'" }
[tool.pixi.feature.docs.tasks]
docs-build = { cmd = "sphinx-build -T -b html docs _build/html" }
docs-serve = { cmd = "sphinx-autobuild docs _build/html" }
[tool.pixi.feature.data-mgmt.tasks]
jupyter = { cmd = "jupyter lab" }
# Data management feature dependencies (conda-forge)
[tool.pixi.feature.data-mgmt.dependencies]
awscli = ">=2.30.2,<3"
boto3 = ">=1.40.18,<2"
netcdf4 = ">=1.7.2,<2"
patool = ">=4.0.1,<5"
# Dev feature dependencies (conda-forge)
[tool.pixi.feature.dev.dependencies]
pre-commit = ">=4.3.0,<5"
pytest = ">=8.4.2,<9"
pytest-cov = ">=7.0.0,<8"
ruff = ">=0.13.0,<0.14"
# Dev-only PyPI deps (kept on PyPI because not available on conda-forge)
[tool.pixi.feature.dev.pypi-dependencies]
# Docs feature dependencies (conda-forge)
[tool.pixi.feature.docs.dependencies]
myst-nb = ">=1.3.0,<2"
ruff = ">=0.12.12,<0.14"
sphinx-autobuild = ">=2025.8.25,<2026"
sphinx-book-theme = ">=1.1.4,<2"
sphinx-click = ">=6.2.0,<7"
sphinx-copybutton = ">=0.5.2,<0.6"
sphinx-design = ">=0.7.0,<0.8"
sphinxcontrib-mermaid = ">=2.0.0,<3"
sphinxext-opengraph = ">=0.13.0,<0.14"
[tool.pixi.feature.docs.pypi-dependencies]
[tool.pixi.feature.coiled-deploy.dependencies]
coiled = ">=1.120.0,<2"
jupyter-server-proxy = ">=4.4.0,<5"
jupyterlab = ">=4.4.7,<5"
tippecanoe = ">=2.78.0,<3"
# Project-wide Conda dependencies (runtime + CLI + geo stack)
[tool.pixi.dependencies]
bottleneck = ">=1.6.0,<2"
cartopy = ">=0.25.0,<0.26"
dask = ">=2025.12.0,<2026"
duckdb = ">=1.3.2,<2"
duckdb-cli = ">=1.3.2,<2"
flox = ">=0.10.6,<0.11"
fsspec = ">=2025.9.0,<2026"
gdal = ">=3.10.3,<4"
geopandas = ">=1.1.1,<2"
icechunk = ">=1.1.5,<2"
libgdal-arrow-parquet = ">=3.10.3,<4"
lonboard = ">=0.11.1,<0.14"
morecantile = ">=6.2.0,<7"
numcodecs = ">=0.16.1,<0.17"
obstore = ">=0.8.2,<0.9"
odc-geo = ">=0.5.0rc1,<0.6"
opencv = ">=4.12.0,<5"
pint-xarray = ">=0.6.0,<0.7"
pooch = ">=1.8.2,<2"
pyarrow = ">=21.0.0,<22"
pydantic = ">=2.11.9,<3"
pydantic-extra-types = ">=2.10.5,<3"
pydantic-settings = ">=2.10.1,<3"
pyproj = ">=3.7.2,<4"
python = "3.13.*"
rasterio = ">=1.4.3,<2"
rich = ">=14.1.0,<15"
rioxarray = ">=0.19.0,<0.20"
s3fs = ">=2025.9.0,<2026"
seaborn = ">=0.13.2,<0.14"
semver = ">=3.0.4,<4"
syrupy = ">=5.0.0,<6"
tqdm = ">=4.67.1,<5"
typer = ">=0.17.4,<0.18"
universal-pathlib = ">=0.2.6,<0.3"
xarray = ">=2025.9.0,<2026"
xclim = ">=0.58.1,<0.59"
zarr = ">=3.1.2,<4"
[tool.pixi.tasks]
export-and-create-coiled = { cmd = "pixi project export conda-environment | python .github/scripts/export_pixi_to_conda.py --stdin --output environment.yaml --create-coiled" }
export-conda-file = { cmd = "pixi project export conda-environment > environment.yml" }
export-conda-file-clean = { cmd = "pixi project export conda-environment | python .github/scripts/export_pixi_to_conda.py --stdin --output environment.yaml" }
start-coiled-notebook = { cmd = "NAME=\"ocr-$(date +%Y%m%d-%H%M%S)\"; COILED_ENV_NAME=\"$NAME\" pixi run export-and-create-coiled ; coiled notebook start --software \"$NAME\" --sync --vm-type m8g.xlarge --sync-ignore .pixi --sync-ignore .venv --tag Project=OCR" }
start-coiled-notebook-bigger = { cmd = "NAME=\"ocr-$(date +%Y%m%d-%H%M%S)\"; COILED_ENV_NAME=\"$NAME\" pixi run export-and-create-coiled ; coiled notebook start --software \"$NAME\" --sync --vm-type m8g.2xlarge --sync-ignore .pixi --sync-ignore .venv --tag Project=OCR" }
start-coiled-notebook-extra = { cmd = "NAME=\"ocr-$(date +%Y%m%d-%H%M%S)\"; COILED_ENV_NAME=\"$NAME\" pixi run export-and-create-coiled ; coiled notebook start --software \"$NAME\" --sync --vm-type m8g.16xlarge --sync-ignore .pixi --sync-ignore .venv --tag Project=OCR" }