forked from pydata/xarray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
308 lines (275 loc) · 7.83 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
[project]
authors = [
{name = "xarray Developers", email = "[email protected]"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
description = "N-D labeled arrays and datasets in Python"
dynamic = ["version"]
license = {text = "Apache-2.0"}
name = "xarray"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"numpy>=1.23",
"packaging>=22",
"pandas>=1.5",
]
[project.optional-dependencies]
accel = ["scipy", "bottleneck", "numbagg", "flox", "opt_einsum"]
complete = ["xarray[accel,io,parallel,viz,dev]"]
dev = [
"hypothesis",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-env",
"pytest-xdist",
"pytest-timeout",
"ruff",
"xarray[complete]",
]
io = ["netCDF4", "h5netcdf", "scipy", 'pydap; python_version<"3.10"', "zarr", "fsspec", "cftime", "pooch"]
parallel = ["dask[complete]"]
viz = ["matplotlib", "seaborn", "nc-time-axis"]
[project.urls]
Documentation = "https://docs.xarray.dev"
SciPy2015-talk = "https://www.youtube.com/watch?v=X0pAhJgySxk"
homepage = "https://xarray.dev/"
issue-tracker = "https://github.com/pydata/xarray/issues"
source-code = "https://github.com/pydata/xarray"
[project.entry-points."xarray.chunkmanagers"]
dask = "xarray.namedarray.daskmanager:DaskManager"
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=42",
"setuptools-scm>=7",
]
[tool.setuptools]
packages = ["xarray"]
[tool.setuptools_scm]
fallback_version = "9999"
[tool.coverage.run]
omit = [
"*/xarray/tests/*",
"*/xarray/core/dask_array_compat.py",
"*/xarray/core/npcompat.py",
"*/xarray/core/pdcompat.py",
"*/xarray/core/pycompat.py",
"*/xarray/core/types.py",
]
source = ["xarray"]
[tool.coverage.report]
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING"]
[tool.mypy]
enable_error_code = "redundant-self"
exclude = [
'xarray/util/generate_.*\.py',
'xarray/datatree_/.*\.py',
]
files = "xarray"
show_error_codes = true
show_error_context = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
# Ignore mypy errors for modules imported from datatree_.
[[tool.mypy.overrides]]
module = "xarray.datatree_.*"
ignore_errors = true
# Much of the numerical computing stack doesn't have type annotations yet.
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"affine.*",
"bottleneck.*",
"cartopy.*",
"cf_units.*",
"cfgrib.*",
"cftime.*",
"cloudpickle.*",
"cubed.*",
"cupy.*",
"dask.types.*",
"fsspec.*",
"h5netcdf.*",
"h5py.*",
"iris.*",
"matplotlib.*",
"mpl_toolkits.*",
"Nio.*",
"nc_time_axis.*",
"numbagg.*",
"netCDF4.*",
"netcdftime.*",
"opt_einsum.*",
"pandas.*",
"pooch.*",
"pydap.*",
"pytest.*",
"scipy.*",
"seaborn.*",
"setuptools",
"sparse.*",
"toolz.*",
"zarr.*",
"numpy.exceptions.*", # remove once support for `numpy<2.0` has been dropped
"array_api_strict.*",
]
# Gradually we want to add more modules to this list, ratcheting up our total
# coverage. Once a module is here, functions are checked by mypy regardless of
# whether they have type annotations. It would be especially useful to have test
# files listed here, because without them being checked, we don't have a great
# way of testing our annotations.
[[tool.mypy.overrides]]
check_untyped_defs = true
module = [
"xarray.core.accessor_dt",
"xarray.core.accessor_str",
"xarray.core.alignment",
"xarray.core.computation",
"xarray.core.rolling_exp",
"xarray.indexes.*",
"xarray.tests.*",
]
# This then excludes some modules from the above list. (So ideally we remove
# from here in time...)
[[tool.mypy.overrides]]
check_untyped_defs = false
module = [
"xarray.tests.test_coarsen",
"xarray.tests.test_coding_times",
"xarray.tests.test_combine",
"xarray.tests.test_computation",
"xarray.tests.test_concat",
"xarray.tests.test_coordinates",
"xarray.tests.test_dask",
"xarray.tests.test_dataarray",
"xarray.tests.test_duck_array_ops",
"xarray.tests.test_indexing",
"xarray.tests.test_merge",
"xarray.tests.test_missing",
"xarray.tests.test_parallelcompat",
"xarray.tests.test_sparse",
"xarray.tests.test_ufuncs",
"xarray.tests.test_units",
"xarray.tests.test_utils",
"xarray.tests.test_variable",
"xarray.tests.test_weighted",
]
# Use strict = true whenever namedarray has become standalone. In the meantime
# don't forget to add all new files related to namedarray here:
# ref: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
[[tool.mypy.overrides]]
# Start off with these
warn_unused_ignores = true
# Getting these passing should be easy
strict_concatenate = true
strict_equality = true
# Strongly recommend enabling this one as soon as you can
check_untyped_defs = true
# These shouldn't be too much additional work, but may be tricky to
# get passing if you use a lot of untyped libraries
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
# These next few are various gradations of forcing use of type annotations
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
# This one isn't too hard to get passing, but return on investment is lower
no_implicit_reexport = true
# This one can be tricky to get passing if you use a lot of untyped libraries
warn_return_any = true
module = ["xarray.namedarray.*", "xarray.tests.test_namedarray"]
[tool.pyright]
# include = ["src"]
# exclude = ["**/node_modules",
# "**/__pycache__",
# "src/experimental",
# "src/typestubs"
# ]
# ignore = ["src/oldstuff"]
defineConstant = {DEBUG = true}
# stubPath = "src/stubs"
# venv = "env367"
# Enabling this means that developers who have disabled the warning locally —
# because not all dependencies are installable — are overridden
# reportMissingImports = true
reportMissingTypeStubs = false
# pythonVersion = "3.6"
# pythonPlatform = "Linux"
# executionEnvironments = [
# { root = "src/web", pythonVersion = "3.5", pythonPlatform = "Windows", extraPaths = [ "src/service_libs" ] },
# { root = "src/sdk", pythonVersion = "3.0", extraPaths = [ "src/backend" ] },
# { root = "src/tests", extraPaths = ["src/tests/e2e", "src/sdk" ]},
# { root = "src" }
# ]
[tool.ruff]
builtins = ["ellipsis"]
extend-exclude = [
"doc",
"_typed_ops.pyi",
]
target-version = "py39"
[tool.ruff.lint]
# E402: module level import not at top of file
# E501: line too long - let black worry about that
# E731: do not assign a lambda expression, use a def
ignore = [
"E402",
"E501",
"E731",
]
select = [
"F", # Pyflakes
"E", # Pycodestyle
"W",
"TID", # flake8-tidy-imports (absolute imports)
"I", # isort
"UP", # Pyupgrade
]
extend-safe-fixes = [
"TID252", # absolute imports
]
[tool.ruff.lint.per-file-ignores]
# don't enforce absolute imports
"asv_bench/**" = ["TID252"]
[tool.ruff.lint.isort]
known-first-party = ["xarray"]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
[tool.pytest.ini_options]
addopts = ["--strict-config", "--strict-markers"]
filterwarnings = [
"ignore:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning",
]
log_cli_level = "INFO"
markers = [
"flaky: flaky tests",
"network: tests requiring a network connection",
"slow: slow tests",
"slow_hypothesis: slow hypothesis tests",
]
minversion = "7"
python_files = "test_*.py"
testpaths = ["xarray/tests", "properties"]
[tool.aliases]
test = "pytest"
[tool.repo-review]
ignore = [
"PP308", # This option creates a large amount of log lines.
]