-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
291 lines (267 loc) · 8.04 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "lmo"
description = "L-moments for robust data science."
version = "0.15.0.dev0"
authors = [{name = "Joren Hammudoglu", email = "[email protected]"}]
readme = "README.md"
license = "BSD-3-Clause"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Education",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Office/Business :: Financial",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Hydrology",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Utilities",
"Typing :: Typed",
]
# https://scientific-python.org/specs/spec-0000/
requires-python = ">=3.11"
dependencies = [
"typing_extensions>=4.10; python_version<'3.13'",
"numpy>=1.25.2",
"scipy>=1.11.4",
"scipy-stubs[scipy]>=1.14.1.6",
]
[project.optional-dependencies]
pandas = ["pandas>=2.0"]
[project.urls]
Repository = "https://github.com/jorenham/Lmo/"
Documentation = "https://jorenham.github.io/Lmo/"
Issues = "https://github.com/jorenham/Lmo/issues"
Changelog = "https://github.com/jorenham/Lmo/releases"
Funding = "https://github.com/sponsors/jorenham"
[dependency-groups]
debug = [
"ipython>=8.31.0",
"ipykernel>=6.29.5",
"line_profiler>=4.2.0",
"matplotlib>=3.10.0",
"typing-extensions>=4.12.2",
]
docs = [
"mkdocs>=1.6.1",
"mkdocs-bibtex>=2.16.2",
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
"mkdocs-include-markdown-plugin>=7.1.2",
"mkdocs-jupyter>=0.25.1",
"mkdocs-material>=9.5.49",
"mkdocs-minify-plugin>=0.8.0",
"mkdocstrings[python]>=0.27.0",
]
pandas = [
"pandas>=2.2.3",
"pandas-stubs>=2.2.3.241126",
]
dev = [
"blacken-docs>=1.19.1",
"codespell>=2.3.0",
"hypothesis[numpy]>=6.123.17",
"pre-commit>=4.0.1",
"basedpyright>=1.24.0",
"pytest>=8.3.4",
"pytest-doctestplus>=1.3.0",
"ruff>=0.9.1",
"sp-repo-review[cli]>=2024.8.19",
"tox>=4.23.2",
]
[tool.uv]
default-groups = ["dev", "docs", "debug", "pandas"]
[tool.codespell]
skip = "*.bib,*.css,*.ipynb,*.js,*.lock,*.pyc,*.svg,./site,"
context = 2
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra",
"--doctest-ignore-import-errors",
"--strict-config",
"--strict-markers",
]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "FLOAT_CMP"]
doctest_plus = "enabled"
doctest_subpackage_requires = {"lmo/contrib/pandas.py" = "pandas>=2.0"}
filterwarnings = [
"error",
'ignore:use lmo.l_moments?\(\) instead:DeprecationWarning',
]
log_cli_level = "INFO"
testpaths = ["lmo", "tests"]
xfail_strict = true
[tool.pyright]
include = ["lmo", "tests", "typetests"]
exclude = ["docs"]
ignore = ["lmo/contrib/pandas.py"]
stubPath = "."
venvPath = "."
venv = ".venv"
defineConstant = {NP2 = true}
pythonVersion = "3.11"
pythonPlatform = "All"
typeCheckingMode = "strict"
enableExperimentalFeatures = true
# discouraged options
enableReachabilityAnalysis = false
enableTypeIgnoreComments = false
# for pyright compatibility
deprecateTypingAliases = true
reportMissingModuleSource = true
reportCallInDefaultInitializer = true
reportImplicitOverride = true
reportImplicitStringConcatenation = false
reportImportCycles = false # TODO
reportMissingSuperCall = true
reportPropertyTypeMismatch = true
reportShadowedImports = true
reportUninitializedInstanceVariable = true
reportUnnecessaryTypeIgnoreComment = true
reportUnusedCallResult = false # https://github.com/microsoft/pyright/issues/8650
reportUnreachable = false # `if sys.version_info() >= ...`
reportAny = false # TODO
reportIgnoreCommentWithoutRule = true
reportPrivateLocalImportUsage = true
reportImplicitRelativeImport = true
reportInvalidCast = false # TODO
reportUnsafeMultipleInheritance = true
# already handled by ruff
reportUnusedParameter = false # dupe of ARG002
reportUnusedImport = false # dupe of F401
reportUnusedVariable = false # dupe of F841
[tool.repo-review]
# TODO: basedmypy
ignore = ["PC140", "MY", "RTD"]
[tool.ruff]
force-exclude = true
extend-exclude = ["docs/gallery"] # TODO
indent-width = 4
line-length = 88
show-fixes = true
src = ["lmo", "tests"]
[tool.ruff.format]
docstring-code-format = true
indent-style = "space"
line-ending = "lf"
preview = true
quote-style = "double"
[tool.ruff.lint]
preview = true
select = ["ALL"]
ignore = [
"DOC", # pydoclint
"FBT", # flake8-boolean-trap
"CPY", # flake8-copyright
"EM", # flake8-errmsg
"TD", # flake8-todos
"FIX", # flake8-fixme
"ERA", # eradicate
# pydocstyle
"D200", # fits-on-one-line
"D205", # blank-line-after-summary
"D212", # multi-line-summary-first-line
# flake8-annotations
"ANN401", # any-type
# flake8-bandit
"S101", # assert
# flake8-commas
"COM812", # missing-trailing-comma (ruff format)
# flake8-implicit-str-concat
"ISC001", # single-line-implicit-string-concatenation (ruff format)
# pylint
"PLC0415", # import-outside-top-level
"PLR0904", # too-many-arguments
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-public-methods
"PLR0914", # too-many-locals
"PLR0915", # too-many-statements
"PLR0917", # too-many-positional
"PLR6301", # no-self-use
# ruff
"RUF021", # parenthesize-chained-operators
# TODO: re-enable once we have `ruff>=0.7.3`
# https://github.com/astral-sh/ruff/issues/14047
"UP044",
]
typing-modules = ["typing", "typing_extensions"]
[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["D", "ANN", "I001", "T201", "N812", "N816"]
"tests/*" = ["D", "N806", "ANN", "TCH001", "TCH002", "PLC2701"]
"typetests/*" = ["D", "INP001"]
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["*_gen", "l_rv_*"]
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = [
"typing.overload",
"typing.override",
"typing_extensions.overload",
"typing_extensions.override",
]
[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
force-wrap-aliases = true
known-first-party = ["lmo"]
known-third-party = ["numpy", "pandas", "scipy"]
no-lines-before = ["future", "local-folder"]
split-on-trailing-comma = false
[tool.ruff.lint.flake8-import-conventions]
banned-from = [
"lmo.typing",
"numpy",
"numpy.polynomial",
"numpy.typing",
"optype",
"optype.numpy",
"optype.typing",
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"lmo.typing" = "lmt"
"numpy.polynomial" = "npp"
"numpy.typing" = "npt"
"optype" = "op"
"optype.numpy" = "onp"
"optype.typing" = "opt"
"scipy.special" = "sps"
[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["lmo", "optype", "typing", "typing_extensions"]
quote-annotations = true
[tool.ruff.lint.pylint]
allow-dunder-method-names = ["__array__", "__lmo_register__"]
allow-magic-value-types = ["int" ,"str"]
[tool.tox]
isolated_build = true
env_list = ["repo-review", "pre-commit", "3.11", "3.12", "3.13"]
[tool.tox.env_run_base]
description = "test with {base_python}"
skip_install = true
allowlist_externals = ["uv"]
commands_pre = [["uv", "sync", "--frozen", "--dev"]]
commands = [["uv", "run", "pytest"]]
[tool.tox.env.pre-commit]
description = "pre-commit"
skip_install = true
allowlist_externals = ["uv"]
commands_pre = [["uv", "sync", "--frozen", "--dev"]]
commands = [["uv", "run", "pre-commit", "run", "--all-files"]]
[tool.tox.env.repo-review]
description = "repo-review"
skip_install = true
allowlist_externals = ["uv"]
commands_pre = [["uv", "sync", "--frozen", "--dev"]]
commands = [["uv", "run", "repo-review", "."]]