-
-
Notifications
You must be signed in to change notification settings - Fork 279
Expand file tree
/
Copy pathpyproject.toml
More file actions
250 lines (234 loc) · 7.56 KB
/
pyproject.toml
File metadata and controls
250 lines (234 loc) · 7.56 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
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
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]
[project]
authors = [{name = "Giampaolo Rodola'", email = "[email protected]"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python",
"Topic :: Internet :: File Transfer Protocol (FTP)",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Filesystems",
]
dependencies = [
"pyasynchat; python_version >= '3.12'",
"pyasyncore; python_version >= '3.12'",
]
description = "Very fast asynchronous FTP server library"
dynamic = ["version"]
keywords = [
"asynchronous",
"daemon",
"eventdriven",
"ftp",
"ftpd",
"ftps",
"nonblocking",
"python",
"rfc1123",
"rfc2228",
"rfc2428",
"rfc2640",
"rfc3659",
"rfc959",
"sendfile",
"server",
"ssl",
]
name = "pyftpdlib"
readme = "README.rst"
requires-python = ">=3.6"
[project.optional-dependencies]
dev = [
"black",
"build",
"check-manifest",
"coverage",
"pdbpp; os_name == 'nt'",
"pylint",
"pyreadline3; os_name == 'nt'",
"pytest-cov",
"pytest-xdist",
"rstcheck",
"ruff",
"toml-sort",
"twine",
]
ssl = ["PyOpenSSL"]
test = [
"psutil",
"pyasynchat; python_version >= '3.12'",
"pyasyncore; python_version >= '3.12'",
"pyopenssl",
"pytest",
"pytest-instafail",
"pytest-xdist",
"pywin32; os_name == 'nt'",
"setuptools",
]
[project.urls]
Homepage = "https://github.com/giampaolo/pyftpdlib/"
[tool.setuptools]
script-files = ["scripts/ftpbench"]
[tool.setuptools.dynamic]
version = {attr = "pyftpdlib.__ver__"}
[tool.setuptools.packages.find]
include = ["pyftpdlib*"]
[tool.black]
target-version = ["py37"]
line-length = 79
# 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", "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 = [
"ALL", # to get a list of all values: `python3 -m ruff linter`
"PLR5501", # [*] Use `elif` instead of `else` then `if`, to reduce indentation
"PLR6104", # Use `+=` to perform an augmented assignment directly
"PLW0602", # Using global for `x` but no assignment is done
]
ignore = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"BLE001", # Do not catch blind exception: `Exception`
"C4", # flake8-comprehensions
# "C408", # Unnecessary `dict` call (rewrite as a literal)
"C90", # mccabe (function `X` is too complex)
"COM812", # Trailing comma missing
"D", # pydocstyle
"DOC201", # `return` is not documented in docstring
"DOC402", # `yield` is not documented in docstring
"DOC501", # Raised exception `X` missing from docstring
"DTZ", # flake8-datetimez
"EM", # flake8-errmsg
"ERA001", # Found commented-out code
"FBT", # flake8-boolean-trap
"FIX", # Line contains TODO / XXX / ..., consider resolving the issue
"FURB101", # `open` and `read` should be replaced by `Path(x).read_text()`
"FURB103", # `open` and `write` should be replaced by `Path(...).write_bytes(data)`
"INP", # `docs/conf.py` is part of an implicit namespace package. Add an `__init__.py`.
"N801", # Class name `async_chat` should use CapWords convention (ASYNCORE COMPAT)
"N802", # Function name X should be lowercase.
"N803", # Argument name X should be lowercase.
"N806", # Variable X in function should be lowercase.
"N812", # Lowercase `error` imported as non-lowercase `FooBarError`
"N818", # Exception name `FooBar` should be named with an Error suffix
"PERF", # Perflint
"PLC2701", # Private name import `_winreg`
"PLR", # pylint
"PLW", # pylint
"PT003", # `scope='function'` is implied in `@pytest.fixture()`
"PT011", # `pytest.raises(OSError)` is too broad, set the `match` parameter or use a more specific exception
"PT021", # Use `yield` instead of `request.addfinalizer`
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF005", # Consider iterable unpacking instead of concatenation
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF028", # This suppression comment is invalid
"RUF031", # [*] Avoid parentheses for tuples in subscripts
"RUF043", # Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
"RUF067", # `__init__` module should only contain docstrings and re-exports
"S", # flake8-bandit
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM105", # Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass`
"SIM115", # Use context handler for opening files
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SLF", # flake8-self
"TD", # all TODOs, XXXs, etc.
"TRY003", # Avoid specifying long messages outside the exception class
"TRY300", # Consider moving this statement to an `else` block
"TRY301", # Abstract `raise` to an inner function
"UP031", # Use format specifiers instead of percent format
]
[tool.ruff.lint.per-file-ignores]
".git_pre_commit.py" = ["T201"] # T201 == print()
"demo/*" = ["T201"]
"doc/*" = ["T201"]
"scripts/*" = ["T201"]
[tool.ruff.lint.isort]
# https://beta.ruff.rs/docs/settings/#isort
force-single-line = true # one import per line
[tool.coverage.report]
omit = [
"pyftpdlib/_compat.py",
"tests/*",
]
exclude_lines = [
"except ImportError:",
"if __name__ == .__main__.:",
"if hasattr(select, 'devpoll'):",
"if hasattr(select, 'epoll'):",
"if hasattr(select, 'kqueue'):",
"if hasattr(select, 'kqueue'):",
"if os.name == 'nt':",
"pragma: no cover",
"raise NotImplementedError('must be implemented in subclass')",
]
[tool.pylint.messages_control]
disable = [
"broad-except",
"consider-using-f-string",
"fixme",
"import-outside-toplevel",
"inconsistent-return-statements",
"invalid-name",
"logging-not-lazy",
"misplaced-bare-raise",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-else-continue",
"no-else-raise",
"no-else-return",
"protected-access",
"raise-missing-from",
"redefined-builtin",
"too-few-public-methods",
"too-many-instance-attributes",
"ungrouped-imports",
"unspecified-encoding",
"use-maxsplit-arg",
"useless-object-inheritance",
]
[tool.pytest.ini_options]
addopts = '''
--verbose
--capture=no
--no-header
--tb=short
--strict-config
--strict-markers
--instafail
-p no:junitxml
-p no:doctest
-p no:nose
-p no:pastebin
-p instafail
-p xdist
'''
testpaths = ["tests/"]
[tool.rstcheck]
ignore_messages = [
"Unexpected possible title overline or transition",
'Hyperlink target "changing-the-concurrency-model" is not referenced.',
'Hyperlink target "ftps-server" is not referenced.',
'Hyperlink target "pre-fork-model" is not referenced.',
]
[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