-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
117 lines (104 loc) · 3.54 KB
/
Copy pathpyproject.toml
File metadata and controls
117 lines (104 loc) · 3.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
[project]
name = "corrode"
version = "1.0.0"
description = "A Rust-like Result type for Python"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{ name = "Roman Kitaev", email = "802.11g@bk.ru" },
]
keywords = ["rust", "result", "error-handling", "enum"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
"typing_extensions>=4.10.0; python_version < '3.13'",
]
[project.urls]
Homepage = "https://github.com/deliro/corrode"
Repository = "https://github.com/deliro/corrode"
Issues = "https://github.com/deliro/corrode/issues"
Changelog = "https://github.com/deliro/corrode/blob/main/CHANGELOG.md"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/corrode"]
[dependency-groups]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"pytest-asyncio>=0.24",
"pytest-mypy-plugins>=3.0",
"mypy>=1.0",
"ruff>=0.8",
]
docs = [
"mike>=2.1",
"mkdocs-material>=9.5",
"mkdocstrings[python]>=0.26",
]
[tool.mypy]
packages = ["corrode"]
mypy_path = "src"
ignore_missing_imports = true
strict = true
strict_bytes = true
local_partial_types = true
warn_unreachable = true
[tool.ruff]
line-length = 99
target-version = "py311"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"COM812", # trailing comma — conflicts with the formatter, which owns this
"CPY001", # per-file copyright headers — the MIT LICENSE covers the project
"D105", # missing docstring in magic methods (__repr__, etc.)
"D107", # missing docstring in __init__
"D203", # `incorrect-blank-line-before-class` — conflicts with the formatter
"D211", # `no-blank-line-before-class`
"D212", # `multi-line-summary-first-line`
"TC003", # imports not behind TYPE_CHECKING — intentional throughout the project
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ANN", # type annotations not required in tests
"D", # docstrings not required in tests
"E731", # lambda assignments are fine in tests
"EM101", # string literals in exceptions are fine in tests
"ERA001", # section header comments are not commented-out code
"PERF401", # manual list.append in loops is fine in tests
"FBT", # boolean positional args are fine in tests
"PLR2004", # magic values are fine in tests
"PT009", # use of unittest-style assertEqual
"S101", # assert is fine in tests
"S307", # eval is fine in tests
"SLF001", # private member access is fine in tests
"TRY003", # long exception messages are fine in tests
]
"tests/type_checking/typesafety.py" = [
"INP001", # not a package, just a type-checking target
"TC003", # imports must be real, not behind TYPE_CHECKING
]
[tool.basedpyright]
typeCheckingMode = "standard"
pythonVersion = "3.11"
include = ["src/corrode", "tests/type_checking/typesafety.py"]
[tool.ty.rules]
invalid-return-type = "ignore" # false positive: except clause narrowing
unused-type-ignore-comment = "ignore" # conflicts with mypy's type: ignore
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests", "src/corrode"]
addopts = "--doctest-modules --ignore=tests/type_checking/typesafety.py"