generated from bentheiii/template-python-poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
111 lines (97 loc) · 3.5 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
[tool.poetry]
name = "envolved"
version = "1.7.0"
description = ""
authors = ["ben avrahami <[email protected]>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/bentheiii/envolved"
packages = [
{include="envolved"},
{include="envolved/py.typed"}
]
[tool.poetry.dependencies]
python = "^3.8"
typing-extensions = "*"
[tool.poetry.group.dev.dependencies]
pytest = "*"
mypy = {version="*", python=">=3.8"}
pytest-cov = "^4.1.0"
ruff = {version="*", python=">=3.8"}
pydantic = "^2.5.2"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
sphinx = {version="^7", python = ">=3.12"}
furo = {version="*", python = ">=3.12"}
sluth = {version="*", python = ">=3.12"}
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[tool.ruff]
target-version = "py38"
line-length = 120
output-format = "full"
[tool.ruff.lint]
exclude = ["docs/**"]
# https://beta.ruff.rs/docs/rules/
select = ["I", "E", "W", "F", "N", "S", "BLE", "COM", "C4", "ISC", "ICN", "G", "PIE", "T20", "PYI", "Q", "SLF", "SIM",
"ERA", "PGH", "PLC", "PLE", "PLR", "PLW", "RUF", "PT", "UP", "B", "ANN", "ASYNC", "FBT003", "A", "INP",
"SLOT", "TID", "PTH", "FLY", "PERF"]
# should be included later: RET?, ARG, TRY, DTZ?, FA, RSE?, TCH?
ignore = [
"A002", # argument shadowing builtin
"UP006", # use tuple instead of Tuple
"UP007", # use X|Y
"PLR2004", # Magic value used in comparison
"PLR0913", # Too many arguments to function call
"SIM108", # Use ternary operator instead of `if`-`else`-block
"SIM105", # Use `contextlib.suppress(...)` instead of try-except-pass
"S101", # assert detected
"C901", # too complex
"SIM118", # Use `key in {}` instead of `key in {}.keys()`
"SIM112", # Use capitalized environment variable
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
"ANN401", # Dynamic type annotation
"A003", # class attribute shadows built-in
"PLR0912", # too many branches
# disabled for formatter:
'COM812', 'COM819', 'E501', 'ISC001', 'Q000', 'Q001', 'Q002', 'Q003', 'W191'
]
[tool.ruff.lint.isort]
combine-as-imports=true
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.lint.flake8-self]
ignore-names = ["_get_descendants", "_get_children"]
[tool.ruff.lint.flake8-pytest-style]
raises-require-match-for = []
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ANN", # annotations
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"S105", # Possible hardcoded password
"S113", # Probable use of requests call without timeout
"PIE804", # Unnecessary `dict` kwargs
"PT013", # Found incorrect import of pytest, use simple `import pytest` instead
"PT004", # Fixture does not return anything, add leading underscore
"BLE001", # BLE001 Do not catch blind exception: `Exception`
"F405", # name may be undefined, or defined from star imports
"F403", # star import used; unable to detect undefined names
"T201", # `print` found
"SLF001", # Private member accessed
"PLC1901", # simplify str == ""
"B018", # useless expression
"FBT", # boolean params
"A", # builtin shadowing
"INP", # implicit namespace packages
"PTH", # use pathlib
"PERF", # performance anti-patterns
]
"type_checking/**" = [
"INP001", # implicit namespace packages
]