forked from Parcels-code/Parcels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
181 lines (163 loc) · 5.54 KB
/
pyproject.toml
File metadata and controls
181 lines (163 loc) · 5.54 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
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "parcels"
description = "Framework for Lagrangian tracking of virtual ocean particles in the petascale age."
readme = "README.md"
dynamic = ["version"]
authors = [{ name = "Parcels team" }]
requires-python = ">=3.11"
license = { file = "LICENSE.md" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
]
dependencies = [
"cftime >=1.6.3",
"numpy >=2.1.0",
"dask >=2024.5.1",
"netCDF4 >=1.7.2",
"zarr >=2.15.0,!=2.18.0,<3",
"tqdm >=4.50.0",
"xarray >=2024.5.0",
"uxarray >=2025.3.0",
"pooch >=1.8.0",
"xgcm >=0.9.0",
"cf_xarray >=0.8.6",
]
[project.urls]
homepage = "https://parcels-code.org/"
repository = "https://github.com/Parcels-code/parcels"
Tracker = "https://github.com/Parcels-code/parcels/issues"
[tool.setuptools]
package-dir = { "" = "src" }
packages = ["parcels"]
[tool.setuptools_scm]
write_to = "src/parcels/_version_setup.py"
local_scheme = "no-local-version"
[tool.pytest.ini_options]
addopts = ["--strict-config", "--strict-markers"]
xfail_strict = true
# testpaths = ["tests", "docs/examples"] # TODO v4: Re-enable once examples are back/fixed
testpaths = ["tests"]
python_files = ["test_*.py", "example_*.py", "*tutorial*"]
minversion = "7"
markers = [ # can be skipped by doing `pytest -m "not slow"` etc.
"flaky: flaky tests",
"slow: slow tests",
"v4alpha: failing tests that should work for v4alpha",
"v4future: failing tests that should work for a future release of v4",
"v4remove: failing tests that should probably be removed later",
]
filterwarnings = [
"error:.*removed in a future release of Parcels.*:DeprecationWarning", # Have Parcels DeprecationWarnings fail CI (prevents deprecated items being used in internal code)
]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
select = [
"D", # pydocstyle
"E", # Error
"F", # pyflakes
"I", # isort
"B", # Bugbear
"UP", # pyupgrade
"LOG", # logging
"ICN", # import conventions
# "G", # logging-format
"RUF", # ruff
"ISC001", # single-line-implicit-string-concatenation
"TID", # flake8-tidy-imports
"T100", # Checks for the presence of debugger calls and imports
"N", # pep8 naming conventions
"PGH004", # ensures no blanket noqa's are used
"W", # Pycodestyle warnings
"YTT", # checks for misuse of sys.version or sys.version_info
# "FBT", # checks for boolean traps (which result in poor function API)
# "A", # check for python builtins being used as variables or parameters
# "T20", # disallows printing in code - parcels source code should not have dev debugging statements, or should use logging statements instead of prints
"NPY201", # numpy 2 deprecations
]
exclude = [
"tests-v3/**",
'docs/user_guide/examples_v3/**',
] # TODO v4: Remove once folders are gone
ignore = [
# # Rules intentionally excluded
# line too long (82 > 79 characters)
"E501",
# ‘from module import *’ used; unable to detect undefined names
"F403",
# Mutable class attributes should be annotated with `typing.ClassVar`
"RUF012",
# Consider `(slice(2), *block)` instead of concatenation
"RUF005",
# Prefer `next(iter(variable.items()))` over single element slice
"RUF015",
# Use `X | Y` in `isinstance` (see https://github.com/home-assistant/core/issues/123850)
"UP038",
# Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
"RUF043",
# Parcels specific deviations from PEP8 naming
'N802', # We use function names that are camelcased to denote functions
'N806', # We use capitalized variable names within functions in Parcels to denote fields, as well as multidimensional arrays
'N811', # Well, this just seems like a bad rule O_o
'N816', # TODO: Enable for `src` and consider disabling for notebooks
'N818', # Not all Parcels exceptions should have an "Error" suffix
# # TODO: ignore for now (requires more work). Remove ignore once fixed
# Missing docstring in public module
"D100",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# Missing docstring in __init__
"D400",
# First line should be in imperative mood (requires writing of summaries)
"D401",
# First word of the docstring should not be `This`
"D404",
# 1 blank line required between summary line and description (requires writing of summaries)
"D205",
]
[tool.ruff.lint.per-file-ignores]
# Ignore docstring rules everywhere except for the stable files (particleset.py, interpolators.py).
"!src/parcels/{_core/basegrid,_core/field,_core/fieldset,_core/kernel,_core/particle,_core/particlefile,_core/particleset,_core/uxgrid,_core/xgrid,kernels/advection,kernels/advectiondiffusion,interpolators}.py" = [
# Missing docstring in public class
"D101",
# Missing docstring in public method
"D102",
# Missing docstring in public function
"D103",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.isort]
known-first-party = ["parcels"]
[tool.mypy]
files = [
"parcels/_typing.py",
"parcels/tools/*.py",
"parcels/grid.py",
"parcels/field.py",
"parcels/fieldset.py",
]
[[tool.mypy.overrides]]
module = [
"parcels._version_setup",
"mpi4py",
"scipy.spatial",
"sklearn.cluster",
"zarr",
"cftime",
"pykdtree.kdtree",
"netCDF4",
"pooch",
]
ignore_missing_imports = true