-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
116 lines (92 loc) · 2.37 KB
/
pyproject.toml
File metadata and controls
116 lines (92 loc) · 2.37 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
[project]
dynamic = ["version"]
name = "monads"
description = "Python-flavored `Option` and `Result` types."
authors = [
{name = "Eneg", email = "42005170+Enegg@users.noreply.github.com"},
]
dependencies = [
"attrs >= 24.2.0",
]
requires-python = ">=3.13"
readme = "README.md"
license = {file = "LICENSE"}
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[dependency-groups]
dev = [
"pytest>=8.3.5",
]
[tool.pdm]
distribution = true
[tool.pdm.build]
includes = ["src/monads"]
[tool.pdm.version]
source = "file"
path = "src/monads/__init__.py"
[tool.ruff]
line-length = 100
target-version = "py313"
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
select = [
"ALL",
# preview
"RUF022", # sort __all__
]
ignore = [
"ARG", # unused parameters
"COM812", # don't require commas
"C9", # complexity
"D1", # missing docstrings
"FIX", "TD", # todos
"N806", # non-lowercase function variables
"N818", # naming exceptions as *Error
"S101", # asserts are good
"SLF001", # private member access; handled by pyright
"PYI041", # redundant int | float unions
"INP001",
"PLC0105", # T_co/T_contra, don't care
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = false
[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing"]
[tool.ruff.lint.pylint]
allow-dunder-method-names = [
"__attrs_pre_init__ ",
"__attrs_post_init__",
"__attrs_init__",
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ERA001", # commented out code
"FBT001", # positional bool params
"PLR0124", # x == x
"PLR091", # too many ...
]
[tool.pyright]
typeCheckingMode = "strict"
pythonVersion = "3.13"
# disabled even in strict
deprecateTypingAliases = true
reportImplicitOverride = "warning"
reportUnnecessaryTypeIgnoreComment = "warning"
# prefer "# pyright: ignore[ruleName]" over "# type: ignore"
enableTypeIgnoreComments = false
# downgrade a few common non-issues
reportUnusedImport = "warning"
reportMatchNotExhaustive = "warning"
reportUnnecessaryCast = "warning"
reportUnnecessaryIsInstance = "information"
# explicit cycles due to Option.[ok_or,ok_or_else] / Result.[ok,err]
reportImportCycles = false
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
]