-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
306 lines (270 loc) · 10.5 KB
/
pyproject.toml
File metadata and controls
306 lines (270 loc) · 10.5 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
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
[project]
name = "pyramids-gis"
version = "0.17.0"
description = "GIS utility package"
readme = {file = "README.md", content-type = "text/markdown"}
authors = [
{ name = "Mostafa Farrag", email = "moah.farag@gmail.com" }
]
license = {text = "GNU General Public License v3"}
keywords = ["GIS", "gdal"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: GIS",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
]
requires-python = ">= 3.11, <4"
dependencies = [
"GDAL >=3.10.0,<4",
"geopandas >=1.0.0",
"hpc-utils >=0.1.5",
"numpy >=2.0.0",
"pandas >=2.0.0",
"pyproj >=3.7.0",
"PyYAML >=6.0.0",
"Shapely >=2.0.0",
"scipy >=1.10.0",
]
[project.optional-dependencies]
viz = ["cleopatra[tiles]>=0.8.0"]
lazy = [
"dask>=2024.1.0",
"distributed>=2024.1.0",
"zarr>=2.17.0,<3",
"fsspec>=2024.1.0",
"flox>=0.9.0",
]
xarray = ["xarray>=2023.1.0"]
netcdf-lazy = ["pyramids-gis[lazy]", "kerchunk>=0.2.6", "h5py>=3.8.0"]
parquet = ["pyarrow>=10.0.0"]
parquet-lazy = ["pyramids-gis[lazy,parquet]", "dask-geopandas>=0.5.0"]
[dependency-groups]
dev = [
"nbval >=0.11.0",
"pre-commit >=3.7.1",
"pre-commit-hooks >=4.6.0",
"pytest >=8.2.2",
"pytest-cov >= 5.0.0",
"pytest-env>=1.6.0",
"coverage",
"build>=1.0.0",
"twine>=5.0.0",
"pip",
"jupyterlab",
"notebook",
"jupyter",
"commitizen>=4.8.4",
"mypy>=1.10.0",
"types-PyYAML>=6.0.0",
"pytest-mock>=3.12.0"
]
docs = [
"mkdocs >=1.5.3",
"mkdocs-material >=9.5.3",
"mkdocstrings >=0.24.0",
"mkdocstrings-python >=1.7.5",
"mike >=2.1.3",
"mkdocs-jupyter >=0.25.1",
"mkdocs-autorefs >=1.2",
"mkdocs-macros-plugin >=1.3.7",
"mkdocs-table-reader-plugin >=3.1.0",
"mkdocs-mermaid2-plugin >=1.2.1",
"jupyter-contrib-nbextensions >=0.7.0",
"mkdocs-panzoom-plugin",
"notebook<7.0",
]
notebook = [
"pip",
"jupyterlab",
"notebook",
"jupyter",
"ipykernel"
]
[project.urls]
homepage = "https://github.com/serapeum-org/pyramids"
repository = "https://github.com/serapeum-org/pyramids"
documentation = "https://serapeum-org.github.io/pyramids"
Changelog = "https://github.com/serapeum-org/pyramids/blob/main/docs/change-log.md"
[build-system]
requires = ["setuptools>=80.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
[tool.setuptools.packages.find]
where = ["src"]
include = ["pyramids", "pyramids.*"]
[tool.setuptools.package-data]
pyramids = ["base/data/*.yaml"]
[tool.flake8]
ignore = ["E203", "E266", "E501", "W503", "E722", "C901", "E741", "E731"]
max-line-length = 88
max-complexity = 18
select = "B,C,E,F,W,T4"
[tool.black]
profile = "flake8"
line-length = 88
skip-string-normalization = true
[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
[tool.bandit]
exclude_dirs = ["tests", "examples", "scripts", "planning", "docs"]
skips = ["B101"]
[tool.coverage.run]
branch = true
source = ["src/pyramids"]
[tool.coverage.report]
show_missing = true
fail_under = 90
[tool.mypy]
python_version = "3.11"
mypy_path = "src"
packages = ["pyramids"]
explicit_package_bases = true
warn_return_any = true
warn_unused_configs = false
disallow_untyped_defs = false
check_untyped_defs = true
ignore_missing_imports = true
exclude = [
"tests/",
"examples/",
"docs/",
"scripts/",
"planning/",
]
[[tool.mypy.overrides]]
module = "pyramids.dataset.ops.*"
disable_error_code = [
"attr-defined", "call-arg", "misc", "return-value",
"assignment", "union-attr", "no-any-return", "arg-type",
]
[tool.commitizen]
name = "cz_conventional_commits"
version_provider = "pep621"
tag_format = "$version"
changelog_file = "docs/change-log.md"
update_changelog_on_bump = true
style = [
["qmark", "fg:#ff9d00 bold"],
["question", "bold"],
["answer", "fg:#ff9d00 bold"],
["pointer", "fg:#ff9d00 bold"],
["highlighted", "fg:#ff9d00 bold"],
["selected", "fg:#cc5454"],
["separator", "fg:#cc5454"],
["instruction", ""],
["text", ""],
["disabled", "fg:#858585 italic"]
]
[tool.pytest.ini_options]
env = ["MPLBACKEND=Agg"]
pythonpath = ["src"]
testpaths = ["tests"]
markers = [
"vfs: mark a test as a virtual file system (deselect with '-m \"not vfs\"')",
"slow: mark test as slow (deselect with '-m \"not slow\"')",
"fast: mark test as fast (deselect with '-m \"not fast\"')",
"core: extras-free test (auto-applied when no extras marker is present)",
"plot: tests requiring the [viz] extra (cleopatra) — plotting tests (deselect with '-m \"not plot\"')",
# One marker per remaining [project.optional-dependencies] group.
# Each marker auto-skips when the extra's headline dep is not
# importable (see ``tests/_marks.py`` + ``pytest_collection_modifyitems``
# in ``tests/conftest.py``) so test authors declare intent once via
# ``@pytest.mark.<extra>`` rather than repeating ``try/except
# ImportError`` boilerplate. The [viz] extra is already covered by
# the ``plot`` marker above — don't register a duplicate ``viz`` one.
"lazy: tests requiring the [lazy] extra (dask, distributed, zarr, fsspec, flox)",
"xarray: tests requiring the [xarray] extra (xarray)",
"netcdf_lazy: tests requiring the [netcdf-lazy] extra (kerchunk, h5py, + lazy)",
"parquet: tests requiring the [parquet] extra (pyarrow)",
"parquet_lazy: tests requiring the [parquet-lazy] extra (dask-geopandas, + parquet, + lazy)",
]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-arm64"]
[tool.pixi.pypi-dependencies]
pyramids-gis = { path = ".", editable = true }
[tool.pixi.tasks]
main = { cmd = "pytest -vvv --cov=src/pyramids -sv -m 'not plot and not xarray' --cov-report=xml", description = "Run the main test suite" }
plot = { cmd = "pytest -vvv --cov=src/pyramids --cov-append -sv -m 'plot' --cov-report=xml", description = "Run plot test suite" }
xarray-tests = { cmd = "pytest -vvv --cov=src/pyramids --cov-append -sv -m 'xarray' --cov-report=xml", description = "Run xarray interop tests" }
test-all = { cmd = "pytest -vvv --cov=src/pyramids -sv --cov-report=xml --cov-report=term-missing", description = "Run all testsuite" }
notebooks = { cmd = "pytest --nbval --nbval-lax --verbose docs/examples --ignore-glob='docs/examples/**/dask-lazy-*.ipynb' --ignore-glob='docs/examples/**/lazy-*-complete.ipynb'", description = "check notebooks (skips dask cookbooks — cloud-data ones hit real endpoints; local-data ones need extras envs)" }
jupyter = { cmd = "jupyter lab --no-browser --IdentityProvider.token='' --ServerApp.password='' --port=8889", description = "check notebooks" }
build-dist = { cmd = "python -m build", description = "Build sdist and wheel for PyPI" }
publish-pypi = { cmd = "twine upload --non-interactive --repository pypi dist/*", depends-on = ["build-dist"], description = "Build and upload package to PyPI" }
cz-changelog = { cmd = "cz changelog", description = "Generate changelog using Commitizen" }
cz-bump = { cmd = "cz bump", description = "Bump version using Commitizen" }
mypy = { cmd = "mypy", description = "Run mypy type checking" }
[tool.pixi.environments]
default = {features = ["viz"], solve-group = "default" }
dev = { features = ["viz", "dev", "xarray", "lazy"], solve-group = "default" }
netcdf-lazy = { features = ["viz", "dev", "lazy", "netcdf-lazy"], solve-group = "default" }
parquet = { features = ["viz", "dev", "xarray", "lazy", "parquet"], solve-group = "default" }
parquet-lazy = { features = ["viz", "dev", "xarray", "lazy", "parquet", "parquet-lazy"], solve-group = "default" }
notebook = { features = ["viz", "notebook"], solve-group = "default" }
docs = { features = ["docs"], solve-group = "docs" }
py311 = { features = ["py311", "viz", "dev", "xarray", "lazy"], solve-group = "py311" }
py312 = { features = ["py312", "viz", "dev", "xarray", "lazy"], solve-group = "py312" }
py313 = { features = ["py313", "viz", "dev", "xarray", "lazy"], solve-group = "py313" }
py314 = { features = ["py314", "viz", "dev", "xarray", "lazy"], solve-group = "py314" }
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"
[tool.pixi.feature.py314.dependencies]
python = "3.14.*"
[tool.pixi.feature.dev.dependencies]
scipy = ">=1.17.1,<2"
# Pin zarr via conda because conda-forge defaults to zarr v3 and the
# pyramids lazy stack still targets the v2 API. Also routes dask /
# distributed / fsspec through conda so they share the same numpy ABI as
# libgdal-netcdf / h5py (below).
[tool.pixi.feature.lazy.dependencies]
"dask-core" = ">=2024.1.0"
distributed = ">=2024.1.0"
zarr = ">=2.17.0,<3"
fsspec = ">=2024.1.0"
flox = ">=0.9.0"
# HDF5-linking libraries must come from conda-forge so they share the
# same HDF5 binary that libgdal-netcdf is linked against. PyPI wheels for
# h5py bundle their own HDF5 copy, which causes DLL-shadowing on Windows
# (h5py fails with "DLL load failed while importing defs") once more
# than one HDF5 backend is loaded in-process.
#
# pyramids' lazy NetCDF path is pure GDAL MDArray — it does NOT import
# netCDF4, h5netcdf, or cftime. kerchunk needs h5py to walk HDF5 chunk
# metadata; nothing else in this feature pulls HDF5-adjacent libraries.
[tool.pixi.feature.netcdf-lazy.dependencies]
kerchunk = ">=0.2.6"
# h5py 3.16 moved to hdf5 2.x, but libgdal-netcdf still links hdf5 1.14.x.
# Pin h5py to the last 1.14-compatible release so the whole env shares
# one HDF5 binary. Raise this pin when libgdal-netcdf follows hdf5 2.x.
h5py = ">=3.8.0,<3.16"
# Pin the hdf5 major.minor line explicitly so any future h5py rebuild
# that would drag hdf5 2.x is blocked until libgdal-netcdf follows.
# Without this the solver can pair h5py 3.16 (hdf5 2) with
# libgdal-netcdf (still hdf5 1) and the env silently breaks on Windows.
hdf5 = "1.14.*"
[tool.pixi.feature.parquet.dependencies]
pyarrow = ">=10.0.0"
[tool.pixi.feature.parquet-lazy.dependencies]
dask-geopandas = ">=0.5.0"
[tool.pixi.dependencies]
gdal = ">=3.10.0,<4"
libgdal-netcdf = ">=3.10.0,<4"
libgdal-hdf4 = ">=3.10.0,<4"
# Conda-forge's geopandas-base no longer pulls in a vector-IO backend.
# pyogrio is required for GeoDataFrame.to_file / read_file on every env.
pyogrio = ">=0.7"