-
Notifications
You must be signed in to change notification settings - Fork 32
/
pyproject.toml
305 lines (250 loc) · 8.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
# See https://github.com/SciTools/.github/wiki/Linting for common linter rules
[build-system]
# Defined by PEP 518
requires = [
"setuptools>=61",
"setuptools_scm[toml]>=7",
]
# Defined by PEP 517
build-backend = "setuptools.build_meta"
# Defined by PEP 621
[project]
authors = [
{name = "NCTA Contributors", email = "[email protected]"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
]
description = "Provides support for a cftime axis in matplotlib"
dynamic = [
"dependencies",
"optional-dependencies",
"readme",
"version",
]
keywords = [
"axis",
"cftime",
"matplotlib",
]
license = {text = "BSD-3-Clause"}
name = "nc-time-axis"
requires-python = ">=3.9"
[project.urls]
Code = "https://github.com/SciTools/nc-time-axis"
Discussions = "https://github.com/SciTools/nc-time-axis/discussions"
Issues = "https://github.com/SciTools/nc-time-axis/issues"
[tool.check-manifest]
ignore = [
"src/nc_time_axis/_version.py",
]
[tool.codespell]
ignore-words-list = "assertIn"
skip = ".git,./docs/_build"
[tool.mypy]
disable_error_code = [
# TODO: exceptions that still need investigating are below.
# Might be fixable, or might become permanent (above):
"attr-defined",
"misc",
"no-untyped-call",
"no-untyped-def",
"unreachable", # TODO: Uncomment `warn_unreachable` below when fixed
]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
strict = true
# warn_unreachable = true # TODO: Enable once all unreachable code is fixed
[tool.numpydoc_validation]
checks = [
"all", # Enable all numpydoc validation rules, apart from the following:
# -> Docstring text (summary) should start in the line immediately
# after the opening quotes (not in the same line, or leaving a
# blank line in between)
"GL01", # Permit summary line on same line as docstring opening quotes.
# -> Closing quotes should be placed in the line after the last text
# in the docstring (do not close the quotes in the same line as
# the text, or leave a blank line between the last text and the
# quotes)
"GL02", # Permit a blank line before docstring closing quotes.
# -> Double line break found; please use only one blank line to
# separate sections or paragraphs, and do not leave blank lines
# at the end of docstrings
"GL03", # Ignoring.
# -> See Also section not found
"SA01", # Not all docstrings require a "See Also" section.
# -> No extended summary found
"ES01", # Not all docstrings require an "Extended Summary" section.
# -> No examples section found
"EX01", # Not all docstrings require an "Examples" section.
# -> No Yields section found
"YD01", # Not all docstrings require a "Yields" section.
# TODO: exceptions that still need investigating are below.
# Might be fixable, or might become permanent (above):
"GL08", # No docstring
"SS05", # Summary must start with infinitive verb
"SS06", # Summary should fit on one line
"PR01", # Parameters not documented
"PR06", # Wrong type used
"PR08", # Description should start with capitol letter
"RT01", # No Returns section found
]
exclude = [
'\.__eq__$',
'\.__ne__$',
'\.__repr__$',
]
[tool.pytest.ini_options]
addopts = "-ra -v --doctest-modules --strict-config --strict-markers"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS NUMBER"
#filterwarnings = ["error"] # TODO - PP309; enable once all warnings are fixed
log_cli_level = "INFO"
minversion = "6.0"
testpaths = ["src/nc_time_axis"]
xfail_strict = true
[tool.repo-review]
ignore = [
# https://learn.scientific-python.org/development/guides/style/#PC180
"PC180", # Uses prettier
# TODO: exceptions that still need investigating are below.
# Might be fixable, or might become permanent (above):
"MY103", # Must have warn_unreachable enabled in mypy
"PY007", # Supports an easy task runner (nox or tox)
"PP309", # Filter warnings specified
"PC170", # Uses PyGrep hooks (only needed if rST present)
]
[tool.ruff]
line-length = 88
[tool.ruff.format]
preview = false
[tool.ruff.lint]
ignore = [
# flake8-commas (COM)
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing.
"COM819", # Trailing comma prohibited.
# flake8-implicit-str-concat (ISC)
# https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
# NOTE: This rule may cause conflicts when used with "ruff format".
"ISC001", # Implicitly concatenate string literals on one line.
# TODO: exceptions that still need investigating are below.
# Might be fixable, or might become permanent (above):
"PLR5501", # collapsible-else-if; Preserve readability of TODO block in
# `convert` method
# Flake8-builtins
"A001", # builtin-variable-shadowing
"A002", # undocumented-public-method
# Flake8-annotations
"ANN001", # missing-type-function-argument
"ANN002", # missing-type-args
"ANN003", # missing type annotation for `**kwargs`
"ANN201", # missing-return-type-undocumented-public-function
"ANN202", # missing-return-type-private-function
"ANN204", # missing-return-type-special-method
"ANN205", # missing-return-type-static-method
"ANN206", # missing-return-type-class-method
# Flake8-unused-arguments
"ARG001", # unused-function-argument
"ARG002", # Unused method argument
"ARG003", # unused-class-method-argument
"ARG004", # unused-static-method-argument
# Flake8-bugbear
"B028", # no-explicit-stacklevel
# Flake8-comprehensions
"C408", # unnecessary-collection-call
"C901", # complex-structure
# pydocstyle
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D105", # undocumented-magic-method
"D200", # fits-on-one-line
"D205", # blank-line-after-summary
"D401", # non-imperative-mood
# Flake8-datetimez
"DTZ002", # call-datetime-today
# pycodestyle
"E501", # line-too-long
# Flake8-errmsg
"EM101", # raw-string-in-exception
# Eradicate
"ERA001", # commented-out-code
# Flake8-fixme
"FIX002", # Line contains TODO, consider resolving the issue
# flake8-import-conventions
"ICN001", # unconventional-import-alias
# pep8-naming
"N801", # invalid-class-name
"N802", # invalid-function-name
# numpy
"NPY002", # numpy-legacy-random
# pylint
"PLR0912", # Too many branches
# flake8-pytest-style
"PT009", # pytest-unittest-assertion
"PT027", # pytest-unittest-raises-assertion
# flake8-return
"RET503", # implicit-return
# flake8-bandit
"S101", # Assert used
# flake8-simplify
"SIM102", # collapsible-if
"SIM108", # if-else-block-instead-of-if-exp
# flake8-todos
"TD002", # Missing author in TODO; try
"TD003", # Missing issue link on the line following this TODO
"TD004", # Missing colon in TODO
# tryceratops
"TRY003", # raise-vanilla-args
"TRY004", # type-check-without-type-error
# pyupgrade
"UP008", # super-call-with-parameter
]
preview = false
select = [
"ALL",
# Note: the above "all" disables conflicting rules; if you want a specific
# rule that is skipped then it needs to be enabled explicitly below:
"D212", # Multi-line docstring summary should start at the first line
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
# Change to match specific package name:
known-first-party = ["nc_time_axis"]
[tool.ruff.lint.per-file-ignores]
# All test scripts
"src/nc_time_axis/tests/*.py" = [
"D104", # Missing docstring in public package
"N999", # Invalid module name
]
"docs/conf.py" = [
"INP001", # implicit namespace
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.setuptools]
license-files = ["LICENSE"]
zip-safe = false
[tool.setuptools.dynamic]
dependencies = {file = "requirements/pypi-core.txt"}
readme = {file = "README.md", content-type = "text/markdown"}
[tool.setuptools.dynamic.optional-dependencies]
docs = {file = "requirements/pypi-optional-docs.txt"}
test = {file = "requirements/pypi-optional-test.txt"}
[tool.setuptools.packages.find]
include = ["nc_time_axis*"]
where = ["src"]
[tool.setuptools_scm]
write_to = "src/nc_time_axis/_version.py"
local_scheme = "dirty-tag"