-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
156 lines (138 loc) · 5.23 KB
/
pyproject.toml
File metadata and controls
156 lines (138 loc) · 5.23 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
[project]
name = "slack-notify-master"
description = "Manage your slack notifications"
authors = [{ name = "tanguy stenel", email = "tanguy.sten@hotmail.fr"}]
dynamic = [ "dependencies" ]
requires-python = ">=3.10,<4.0"
[tool.poetry]
package-mode = false
###################################
# Dependencies
###################################
[tool.poetry.dependencies]
dbus-python = "^1.4.0"
pygobject = "^3.52.3"
pyyaml = "^6.0.2"
pydub = "^0.25.1"
[tool.poetry.group.dev.dependencies]
pip = "^25.0.0"
# Style
ruff = "^0.9.0"
mypy = "^1.13.0"
pylint = "^3.0.0"
bandit = {extras = ["toml"], version = "^1.7.2"}
toml = "^0.10.2"
pip-licenses = "^5.0.0"
# Test
urllib3 = "^2.0.0"
python-dotenv = "^1.0.0"
pytest = "^8.0.0"
pytest-cov = "^6.0.0"
pytest-runner = "^6.0.1"
pytest-mock = "^3.12.0"
pytest-asyncio = "^0.25.0"
pytest-order = "^1.2.0"
mock = "^5.1.0"
pyfakefs = "^5.3.2"
hypothesis = "^6.93.0"
requests-mock = "^1.11.0"
decorator = "^5.1.1"
freezegun = "^1.3.1"
pytest-celery = "^0.0.0"
pytest-testmon = "^2.1.1"
pyzipper = "^0.3.6"
###################################
# Tools Config
###################################
pytest-httpx = "^0.35.0"
[tool.ruff]
# Rule list: https://beta.ruff.rs/docs/rules/
line-length = 120
exclude = [
"src/hl_common/hl/common/pb",
]
target-version = "py39"
[tool.ruff.lint]
ignore = [
"E501", # Line too long
"UP006", # requires dict[type] to work in cython
"UP007", # requires type | type... to work in cython
"UP035", # Replacing typing.Mapping... with collections.abc.Mapping... is not supported in Cython
"UP013", # class-style TypedDicts are not supported in Cython
"UP014", # class-style NamedTuples are not supported in Cython
"UP031", # .format conversion, will make correct logger usage harder
"UP032", # F-string conversion, will make correct logger usage harder
"RUF001", "RUF002", "RUF003", # Ambiguous unicode character, way too many false positives. Makes writing comments & tests harder.
"SIM300", # `'constant' == variable` => `variable == 'constant'`, autofix causes issues with tuples: `'a', 'b' == (var1, var2)` => `'a', (var1, var2) == 'b'`
"SIM117", # Combine context managers. Not supported by cython.
"SIM102", # Prevents from putting comments for a specific if branche
"SIM116", # Forces to create a dict where it is not necessary
"SIM114", # combine `if` statements. About 50 errors without autofix. Do this later.
"RUF015", # Prefer `next(...)` over single element slice
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM112", # Use capitalized environment variable
# Pydocstyle rules
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", # Missing docstring in class/modules...
"D206", # Docstring should be indented with spaces, not tabs
"D300", "D301", # Use triple double quotes """ and Use r""" if any backslashes in a docstring
"D401", "D402", "D404", "D414", "D417", "D418", "D419", # Content docstring rules, we should talk about which rules are useful to allow
"D205", "D415", # 1 blank line between summary and description AND first line should end with period/question mark or exclamation point
"ISC001", # Single line implicit string concatenation: conflicts with ruff format
"ISC003", # Implicit string concatenation over multi-lines
"SIM103", # Return the condition directly
]
select= [
"F", # Pyflakes
"E", "W", # pycodestyle
"DTZ", # Ghost of Jerome
"UP", # pyupgrade
"RUF", # ruff
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"I", # isort
"G", # logging format
"D", # pydocstyle
"ISC", # Implicit string concat
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"deploy/*" = ["D", "DTZ005"]
"src/hl_manager/hl/manager/command/__init__.py" = ["I001"] # Avoid circular import error in manager
"src/hl_common/hl/common/model/migrations/*" = ["D"] # Can break migrations
"scripts/*" = ["D"]
# !!! Enforce backend docstring style, when a folder is fixed, remove it from here !!!
"tests/*" = ["D", "DTZ001", "DTZ002", "DTZ003", "DTZ005", "DTZ006", "DTZ007", "DTZ011"]
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.bandit]
exclude_dirs = ['/tests', '/.venv']
skips = [
"B101", # Use of assert detected. The enclosed code will be removed
# when compiling to optimised byte code.
"B104", # Possible binding to all interfaces.
"B303", # Use of insecure MD2, MD4, MD5, or SHA1 hash function.
"B311", # Standard pseudo-random generators are not suitable for security/cryptographic purposes.
"B404", # import_subprocess
"B602", # Test for use of popen with shell equals true
"B603", # Test for use of subprocess without shell equals true
"B604", # Test for any function with shell equals true
]
[tool.mypy]
mypy_path = [
"src/",
]
show_error_codes = true
namespace_packages = true
# mypy rules
# TODO: keep only the strict option
strict = true
warn_return_any = false
disallow_untyped_defs = false
disallow_untyped_decorators = false
disallow_any_generics = false
disallow_subclassing_any = false
disable_error_code = "import"
no_implicit_reexport = false