-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
154 lines (141 loc) · 5.1 KB
/
pyproject.toml
File metadata and controls
154 lines (141 loc) · 5.1 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
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
[project]
name = "psleak"
version = "0.1.5"
description = "Detect memory and resource leaks in Python C extensions"
authors = [
{name = "Giampaolo Rodola", email = "g.rodola@gmail.com"},
]
readme = "README.rst"
requires-python = ">=3.6"
dependencies = [
"psutil>=7.2.1",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Debuggers",
"Topic :: Software Development :: Testing",
"Topic :: System :: Monitoring",
]
[project.optional-dependencies]
test = [
"pytest",
"pytest-instafail",
]
linters = [
"build",
"twine",
"validate-pyproject",
]
[project.urls]
Homepage = "https://github.com/giampaolo/psleak"
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
py-modules = ["psleak"]
[tool.black]
target-version = ["py37"]
line-length = 79
skip-string-normalization = true
# https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html
preview = true
enable-unstable-feature = ["hug_parens_with_braces_and_square_brackets", "multiline_string_handling", "string_processing", "wrap_long_dict_values_in_parens"]
[tool.ruff]
# https://beta.ruff.rs/docs/settings/
target-version = "py37"
line-length = 79
[tool.ruff.lint]
preview = true
select = [
# To get a list of all values: `python3 -m ruff linter`.
"ALL",
"D200", # [*] One-line docstring should fit on one line
"D204", # [*] 1 blank line required after class docstring
"D209", # [*] Multi-line docstring closing quotes should be on a separate line
"D212", # [*] Multi-line docstring summary should start at the first line
"D301", # Use `r"""` if any backslashes in a docstring
"D403", # [*] First word of the first line should be capitalized
"PERF102", # [*] When using only the keys of a dict use the `keys()` method
"PERF401", # Use a list comprehension to create a transformed list
"S113", # Probable use of requests call without timeout
"S602", # `subprocess` call with `shell=True` identified, security issue
]
ignore = [
"ANN", # flake8-annotations
"ARG002", # unused-method-argument
"C90", # mccabe (function `X` is too complex)
"COM812", # Trailing comma missing
"D", # pydocstyle
"DOC", # various docstring warnings
"ERA001", # Found commented-out code
"FBT", # flake8-boolean-trap (makes zero sense)
"FIX", # Line contains TODO / XXX / ..., consider resolving the issue
"FURB101", # `open` and `read` should be replaced by `Path(src).read_text()`
"FURB103", # `open` and `write` should be replaced by `Path(src).write_text()`
"PLC2701", # Private name import `x` from external module `y`
"PLR0904", # Too many public methods (x > y)
"PLR0911", # Too many return statements (8 > 6)
"PLR0912", # Too many branches (x > y)
"PLR0913", # Too many arguments in function definition (x > y)
"PLR0914", # Too many local variables (x/y)
"PLR0915", # Too many statements (x > y)
"PLR0917", # Too many positional arguments (x/y)
"PLR1702", # Too many nested blocks (x > y)
"PLR2004", # Magic value used in comparison, consider replacing X with a constant variable
"PLR6301", # Method `x` could be a function, class method, or static method
"PLW1514", # `open` in text mode without explicit `encoding` argument
"PT028", # pytest-parameter-with-default-argument
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi (python types stuff)
"RET502", # Do not implicitly `return None` in function able to return non-`None` value
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RET504", # Unnecessary assignment to `result` before `return` statement
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # use of assert detected
"SIM105", # Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass`
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SLF", # flake8-self
"TD", # all TODOs, XXXs, etc.
]
[tool.ruff.lint.per-file-ignores]
".github/workflows/*" = ["B904", "EM101", "EM102", "EM103", "T201", "T203"]
"tests/*" = ["B904", "EM101", "EM102", "EM103", "PLC1901", "TRY003"]
[tool.ruff.lint.isort]
force-single-line = true # one import per line
[tool.tomlsort]
in_place = true
no_sort_tables = true
sort_inline_arrays = true
spaces_before_inline_comment = 2
spaces_indent_inline_array = 4
trailing_comma_inline_array = true
[tool.coverage.run]
source = ["."]
omit = [
"tests/*",
]
[tool.rstcheck]
ignore_messages = [
"Hyperlink target \"\\d+\" is not referenced",
]
[tool.pytest]
addopts = [
"--capture=no",
"--instafail",
"--no-header",
"--strict-config",
"--strict-markers",
"--tb=short",
"--verbose",
"-p instafail",
"-p no:cacheprovider",
"-p no:doctest",
"-p no:junitxml",
"-p no:nose",
"-p no:pastebin",
]
verbosity_subtests = "0"
testpaths = ["tests/"]