-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpyproject.toml
283 lines (259 loc) · 7.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
[project]
name = "ncdump-rich"
version = "0.5.2"
description = "Rich NcDump"
authors = [{ name = "Eirik Enger", email = "engeir@pm.me" }]
license = { file = "LICENSE.rst" }
readme = "README.rst"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"click>=8.1.7",
"netcdf4>=1.6.5",
"rich>=13.7.0",
"rich-click>=1.7.3",
]
[project.urls]
"release notes" = "https://github.com/engeir/ncdump-rich/releases"
homepage = "https://github.com/engeir/ncdump-rich"
source = "https://github.com/engeir/ncdump-rich"
documentation = "https://ncdump-rich.readthedocs.io"
tracker = "https://github.com/engeir/ncdump-rich/issues"
[project.scripts]
ncdump-rich = "ncdump_rich.__main__:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool]
rye = { dev-dependencies = [
"coverage>=7.4.3",
"mypy>=1.8.0",
"pre-commit>=3.6.2",
"pre-commit-hooks>=4.5.0",
"pydoclint>=0.4.1",
"pydocstringformatter>=0.7.3",
"pygments>=2.17.2",
"pytest>=8.0.2",
"pytest-cov>=4.1.0",
"pyupgrade>=3.15.1",
"ruff>=0.2.2",
"sphinx>=7.2.6",
"sphinx-autobuild>=2024.2.4",
"sphinx-click>=5.1.0",
"sphinx-rtd-theme>=2.0.0",
"typeguard>=4.1.5",
"xdoctest>=1.1.3",
], managed = true }
[tool.coverage.paths]
source = ["src", "*/site-packages"]
[tool.coverage.run]
branch = true
source = ["ncdump_rich"]
[tool.coverage.report]
show_missing = true
fail_under = 100
[tool.coverage.html]
directory = "htmlcov"
[tool.git-cliff.changelog]
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }} // ({{ commit.committer.name }} <{{ commit.committer.email }}> {{ commit.committer.timestamp | date(format="%Y-%m-%d") }})\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# postprocessors
postprocessors = [
{ pattern = '<REPO>', replace = "https://github.com/engeir/ncdump-rich" }, # replace repository URL
]
[tool.git-cliff.git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
filter_unconventional = true
split_commits = true
# regex for preprocessing the commit messages
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" }, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore|ci", group = "Miscellaneous Tasks" },
{ body = ".*security", group = "Security" },
{ message = "^revert", group = "Revert" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# regex for matching git tags
tag_pattern = "v[0-9].*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
[tool.mypy]
allow_redefinition = false
check_untyped_defs = true
files = ["src", "tests"]
ignore_errors = false
ignore_missing_imports = true
implicit_reexport = false
local_partial_types = true
no_implicit_optional = true
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 88
# Assume Python 3.12
target-version = "py312"
[tool.ruff.lint]
per-file-ignores = {}
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
select = [ # https://docs.astral.sh/ruff/rules/
"B", # flake8-bugbear
"D", # pydocstyle
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"PL", # pylint
"Q", # flake8-quotes
"UP", # pyupgrade
]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
# select = ["E4", "E7", "E9", "F"] # These are the default
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
ignore = [
# "COM812", # Since we don't select COM, this is already ignored
# "COM819", # Since we don't select COM, this is already ignored
"D206",
"D300",
"E111",
"E114",
"E117",
"E266",
"E501",
# "ISC001", # Since we don't select ISC, this is already ignored
# "ISC002", # Since we don't select ISC, this is already ignored
"Q000",
"Q001",
"Q002",
"Q003",
# "W191", # Since we don't select W, this is already ignored
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.pydocstyle]
convention = "numpy"
ignore-decorators = ["typing.overload"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.flake8-import-conventions]
[tool.ruff.lint.flake8-import-conventions.aliases]
# Declare the default aliases.
"matplotlib.pyplot" = "plt"
numpy = "np"
scipy = "sp"
xarray = "xr"
[tool.ruff.lint.isort]
case-sensitive = true
known-local-folder = ["src", "ncdump_rich"]
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88
profile = "black"
combine_as_imports = true
[tool.pydocstringformatter]
write = true
strip-whitespaces = true
split-summary-body = false
numpydoc-section-hyphen-length = false
style = ["pep257", "numpydoc"]