-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpyproject.toml
407 lines (373 loc) · 11.4 KB
/
pyproject.toml
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
[build-system]
requires = ["flit_core >=3.4.0,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "hydromt"
authors = [
{ name = "Dirk Eilander", email = "[email protected]" },
{ name = "Hélène Boisgontier", email = "[email protected]" },
{ name = "Sam Vente", email = "[email protected]" },
]
dependencies = [
"affine", # Spatial rasterers affine transformations (bbox pixel coalision)
"bottleneck", # Spearmen rank computation
"click", # CLI configuration
"dask", # lazy computing
"fsspec", # general file systems utilities
"geopandas>=0.10", # pandas but geo, wraps fiona and shapely
"importlib_metadata", # entrypoints backport
"mercantile", # tile handling
"netcdf4", # netcfd IO
"numba", # speed up computations (used in e.g. stats)
"numpy", # pin necessary to ensure compatability with C headers
"packaging", # compare versions of hydromt
"pandas", # Dataframes
"pooch", # data fetching
"pyarrow<16", # prevents incompat with pandas.
"pydantic~=2.4", # Validation
"pydantic-settings~=2.2", # Settings Management
"pyflwdir>=0.5.4", # Hight models and derivatives
"pyogrio>=0.6", # io for geopandas dataframes
"pyproj", # projections for Coordinate reference systems
"pystac", # STAC integration
"pyyaml", # yaml interface
"rasterio", # raster wrapper around gdal
"requests", # donwload stuff
"rioxarray", # wraps rasterio and xarray. Almost superceded by hydromt/raster.py
"scipy", # scientific utilities
"shapely>=2.0.0", # geometry transforms
"tomli", # parsing toml files
"tomli-w", # writing toml files
"universal_pathlib>=0.2", # provides path compatability between different filesystems
"xarray", # ndim data arrays
"xmltodict", # xml parser also used to read VRT
"xugrid>=0.9.0", # xarray wrapper for mesh processing
"zarr>=2,<3", # zarr
]
requires-python = ">=3.9"
readme = "README.rst"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Hydrology",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
dynamic = ['version', 'description']
[project.optional-dependencies]
io = [
"gcsfs>=2023.12.1", # google cloud file system
"openpyxl", # excel IO
"fastparquet", # parquet IO
"pillow", # image IO
"rio-vrt==0.2.0", # write VRT files
"s3fs", # S3 file system
]
extra = [
"matplotlib", # plotting; required for slippy tiles
"pyet", # calc evapotraspiration, quite well used, used in all wflow models but domain specific
]
dev = [
"flit", # needed to publish to pypi
"mypy", # static type checking
"pandas-stubs", # type hints for pandas
"pre-commit", # linting
"ruff", # linting
"twine", # needed to publish to pypi
"types-openpyxl", # type hints for openpyxl
"types-PyYAML", # type hints for pyyaml
"types-Pillow", # type hints for pillow
"types-requests", # type hints for requests
"types-xmltodict", # type hints for xmltodict
]
test = [
"pytest>=8", # testing framework
"pytest-cov", # test coverage
"pytest-mock", # mocking
"pytest-timeout", # darn hanging tests
]
doc = [
"hydromt[examples,extra]", # examples are included in the docs
"nbsphinx", # build notebooks in docs
"pydata-sphinx-theme>=0.15.2", # theme
"sphinx_autosummary_accessors", # doc layout
"sphinx", # build docks
"sphinx_design", # doc layout
"sphinx-click", # click integration
]
examples = [
"cartopy", # plotting examples
"jupyterlab", # run examples in jupyter notebook
"notebook", # jupyter integration
]
full = ["hydromt[io,extra,dev,test,doc,examples]"]
slim = ["hydromt[io,extra,examples]"]
[project.urls]
Documentation = "https://deltares.github.io/hydromt"
Source = "https://github.com/Deltares/hydromt"
[project.scripts]
hydromt = "hydromt.cli.main:main"
[project.entry-points."hydromt.components"]
core = "hydromt.model.components"
[project.entry-points."hydromt.drivers"]
core = "hydromt.data_catalog.drivers"
[project.entry-points."hydromt.models"]
core = "hydromt.model.model"
[project.entry-points."hydromt.catalogs"]
core = "hydromt.data_catalog.predefined_catalog"
[project.entry-points."hydromt.uri_resolvers"]
core = "hydromt.data_catalog.uri_resolvers"
[tool.setuptools.dynamic]
description = { file = "hydromt/__init__.py" }
[tool.ruff]
line-length = 88
target-version = "py39"
exclude = ["docs"]
[tool.ruff.lint]
# enable pydocstyle (E), pyflake (F) and isort (I), pytest-style (PT), bugbear (B)
select = ["E", "F", "I", "PT", "D", "B", "ICN", "TID"]
ignore = ["D211", "D213", "D206", "E501", "E741", "D105", "E712", "B904"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D100", "D101", "D102", "D103", "D104"]
"hydromt/__init__.py" = ["E402", "F401", "F403"]
"hydromt/models/__init__.py" = ["F401"]
"hydromt/_compat.py" = ["F401"]
"tests/conftest.py" = ["E402"]
"examples/**" = ["B018", "D103"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.flit.sdist]
include = ["hydromt"]
exclude = ["docs", "examples", "envs", "tests", "binder", ".github"]
[tool.pytest.ini_options]
addopts = "--ff "
testpaths = ["tests"]
markers = ["integration: marks tests as being integration tests"]
filterwarnings = [
"error",
# "ignore::rasterio.errors.NotGeoreferencedWarning", # upstream issue with rasterio, see https://github.com/rasterio/rasterio/issues/2497
"ignore:Detected a customized `__new__` method in subclass:DeprecationWarning", #upstream error in universal_pathlib see https://github.com/fsspec/universal_pathlib?tab=readme-ov-file#migrating-to-v020
"ignore::ResourceWarning", # upstream issue with aoihttp, can remove once aoihttp 4.0 is stable: https://github.com/aio-libs/aiohttp/issues/5426
"ignore::pytest.PytestUnraisableExceptionWarning", # combine with the above: https://github.com/pytest-dev/pytest/issues/9825
'ignore:pathlib\.Path\.__enter__:DeprecationWarning', # xugrid in python 3.11
# "ignore:Implicit None on return values is deprecated and will raise KeyErrors:DeprecationWarning"
"ignore:__array_wrap__ must accept context and return_scalar arguments \\(positionally\\) in the future:DeprecationWarning",
]
[tool.mypy]
# TODO: Re-enable the tests
exclude = ["docs/.*", "tests/.*"]
plugins = ["pydantic.mypy", "numpy.typing.mypy_plugin"]
python_version = "3.9"
ignore_missing_imports = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
strict_equality = true
extra_checks = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_any_generics = true
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "win-64"]
[tool.pixi.feature.py39.dependencies]
python = "3.9.*"
[tool.pixi.feature.py310.dependencies]
python = "3.10.*"
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.pypi-dependencies]
hydromt = { path = ".", editable = true }
[tool.pixi.feature.doc.tasks]
doctest = { cmd = [
"sphinx-build",
"-M",
"doctest",
"docs",
"docs/_build",
"-W",
] }
docs-build = { cmd = [
"sphinx-build",
"-M",
"html",
"docs",
"docs/_build",
"-W",
], depends-on = [
"doctest",
] }
docs = { depends-on = ["docs-build"] } # alias
doc = { depends-on = ["docs-build"] } # alias
serve = { cmd = ["python", "-m", "http.server", "-d", "docs/_build/html"] }
[tool.pixi.feature.test.tasks]
test = { cmd = ["pytest"] }
test-lf = { cmd = ["pytest", "--lf", "--tb=short"] }
test-err-warn = { cmd = ["pytest", "--tb=short", "-W", "error"] }
test-cov = { cmd = [
"pytest",
"--verbose",
"--cov=hydromt",
"--cov-report",
"xml",
] }
[tool.pixi.feature.dev.tasks]
install = { depends-on = ["install-pre-commit"] }
install-pre-commit = "pre-commit install"
lint = { cmd = ["pre-commit", "run", "--all"] }
mypy = "mypy ."
docker-build-min = { cmd = [
"docker",
"build",
"-t",
"deltares/hydromt:min",
"--target=min",
"--build-arg",
"PIXIENV=min-py311",
".",
] }
docker-build-full = { cmd = [
"docker",
"build",
"-t",
"deltares/hydromt:full",
"--target=full",
"--build-arg",
"PIXIENV=full-py311",
".",
] }
docker-build-slim = { cmd = [
"docker",
"build",
"-t",
"deltares/hydromt:slim",
"--target=slim",
"--build-arg",
"PIXIENV=slim-py311",
".",
] }
docker-build-latest = { cmd = [
"docker",
"build",
"-t",
"deltares/hydromt:latest",
"--target=slim",
"--build-arg",
"PIXIENV=slim-py311",
".",
] }
docker-publish-min = { cmd = [
"docker",
"push",
"deltares/hydromt:min",
], depends-on = [
"docker-build-min",
] }
docker-publish-slim = { cmd = [
"docker",
"push",
"deltares/hydromt:slim",
], depends-on = [
"docker-build-slim",
] }
docker-publish-latest = { cmd = [
"docker",
"push",
"deltares/hydromt:latest",
], depends-on = [
"docker-build-latest",
] }
docker-publish-full = { cmd = [
"docker",
"push",
"deltares/hydromt:full",
], depends-on = [
"docker-build-full",
] }
docker-publish = { depends-on = [
"docker-publish-min",
"docker-publish-slim",
"docker-publish-latest",
"docker-publish-full",
] }
docker-clean = { cmd = ["docker", "system", "prune", "-f"] }
pypi = { depends-on = [
"pypi-git-clean",
"pypi-git-restore",
"pypi-flit-build",
"pypi-twine",
] }
pypi-git-clean = { cmd = ["git", "clean", "-xdf"] }
pypi-git-resore = { cmd = ["git", "restore", "-SW", "."] }
pypi-flit-build = { cmd = ["flit", "build"] }
pypi-twine = { cmd = ["python", "-m", "twine", "check", "dist/*"] }
# clean
clean = { depends-on = [
"clean-dist",
"clean-docs-generated",
"clean-docs-build",
"clean-docs-exmaples",
] }
clean-dist = { cmd = ["rm", "-rf", "dist"] }
clean-docs-generated = { cmd = ["rm", "-rf", "docs/_generated"] }
clean-docs-build = { cmd = ["rm", "-rf", "docs/_build"] }
clean-docs-exmaples = { cmd = ["rm", "-rf", "docs/examples"] }
[tool.pixi.environments]
default = { features = [
"py39",
"io",
"extra",
"dev",
"test",
"doc",
"examples",
], solve-group = "py39" }
full-py311 = { features = [
"py311",
"io",
"extra",
"dev",
"test",
"doc",
"examples",
], solve-group = "py311" }
slim-py311 = { features = [
"py311",
"io",
"extra",
"examples",
], solve-group = "py311" }
min-py311 = { features = ["py311"], solve-group = "py311" }
full-py310 = { features = [
"py310",
"io",
"extra",
"dev",
"test",
"doc",
"examples",
], solve-group = "py310" }
slim-py310 = { features = [
"py310",
"io",
"extra",
"examples",
], solve-group = "py310" }
min-py310 = { features = ["py310"], solve-group = "py310" }
full-py39 = { features = [
"py39",
"io",
"extra",
"dev",
"test",
"doc",
"examples",
], solve-group = "py39" }
slim-py39 = { features = [
"py39",
"io",
"extra",
"examples",
], solve-group = "py39" }
min-py39 = { features = ["py39"], solve-group = "py39" }