-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathpyproject.toml
More file actions
280 lines (262 loc) · 9.01 KB
/
Copy pathpyproject.toml
File metadata and controls
280 lines (262 loc) · 9.01 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.2", "wheel"]
[project]
authors = [{name = "Gufo Labs"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: Telecommunications Industry",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Networking",
"Topic :: System :: Networking :: Monitoring",
"Operating System :: POSIX :: Linux",
"Typing :: Typed",
]
description = "NOC is an Operation Support System (OSS) for telecom companies, service providers, and enterprise Network Operation Centers"
dynamic = ["version"]
keywords = ["monitoring", "inventory", "fault management", "performance management", "ipam"]
license = {file = "LICENSE.md"}
name = "noc"
requires-python = ">=3.11"
[project.readme]
content-type = "text/markdown"
file = "README.md"
[project.urls]
"Bug Tracker" = "https://github.com/gufolabs/noc/issues"
Changelog = "https://getnoc.com/release-policy/"
Discussions = "https://github.com/gufolabs/noc/discussions"
Documentation = "https://getnoc.com/"
Homepage = "https://getnoc.com/"
"Source Code" = "https://github.com/gufolabs/noc"
[project.optional-dependencies]
activator = ["ssh2-python==1.1.2.post1"]
bh = [
"gufo-ping==0.7.0",
"gufo-traceroute==0.2.0",
]
cache-memcached = ["pylibmc==1.6.3"]
cache-redis = ["hiredis==3.1.0", "redis==4.6.0"]
classifier = ["bitarray==3.7.1"]
dev = [
"Babel==2.13.1",
"ipython==9.5.0",
"pojson==0.7",
]
docs = [
"mkdocs-material==9.7.0",
"mkdocstrings[python]==0.30.1",
"mkdocs-macros-plugin==1.0.5",
"mkdocs-static-i18n==1.3.0",
"mkdocs-gen-files==0.5.0",
"mkdocs-literate-nav==0.6.2",
"minify_html==0.18.1",
"cachetools==5.5.2", # For {{ config_param() }}
]
lint = [
"ruff==0.15.9",
"mypy==1.10",
"mongo-types==0.15.1",
"types-cachetools==5.5.0.20240820",
]
login-ldap = ["ldap3==2.10.2.rc2"]
login-pam = ["python-pam==1.8.4"]
login-radius = ["pyrad==2.4"]
node = [
"aiokafka[lz4,snappy,zstd]==0.13.0",
"Django==4.2.30",
"FastAPI==0.128.8",
"Jinja2==3.1.6",
"PyYAML==6.0.2",
"Pygments==2.19.1",
"XlsxWriter==3.2.2",
"atomicl==0.1.1",
"blinker==1.9.0",
"bsdiff4==1.2.6",
"cachetools==5.5.2",
"crontab==1.0.1",
"siphash24==1.8",
"demjson3==3.0.6",
"dnspython==2.7.0",
"fsspec==2025.12.0",
"geojson==3.2.0",
"geopy==2.4.1",
"gufo-http==0.7.0",
"manhole==1.8.1",
"markerlib==0.6.0",
"mongoengine==0.29.0",
"motor==3.5.1",
"networkx==3.5",
"numpy==2.3.2",
"orjson==3.11.7",
"progressbar2==4.5.0",
"psutil==7.2.2",
"psycopg2-binary==2.9.11",
"polars-lts-cpu==1.24.0",
"pydantic==2.11.10",
"pymongo==4.8.0",
"pyproj==3.7.1",
"py-consul==1.7.1",
"python-creole==1.4.10",
"python-dateutil==2.9.0",
"python-jose[cryptography]==3.5.0",
"setproctitle==1.3.5",
"uvicorn==0.40.0",
'yappi==1.7.3',
"python-multipart==0.0.28", # Used by FastAPI to process form data
"gufo-liftbridge==0.2.0",
"gufo-snmp==0.12.0",
"gufo_noc_speedup==0.1.0",
]
ping = ["gufo-ping==0.7.0"]
prod-tools = [
"sentry-sdk==2.57.0",
"supervisor-wildcards==0.1.3",
]
supervisor = [
"supervisor==4.2.5",
"supervisor-serialrestart==0.1.1",
]
test = [
"pytest==8.4.2",
"pytest-cov==7.0.0",
]
testing = ["dbf==0.99.3"]
vcenter = ["pyvmomi==8.0.3.0.1"]
zabbix = ["zabbix-utils==2.0.2"]
[tool.setuptools]
include-package-data = true
package-dir = {"" = "."}
zip-safe = false
[tool.setuptools.packages.find]
namespaces = true
where = ["src"]
[tool.setuptools.dynamic]
version = {file = "VERSION"}
[tool.setuptools.package-data]
"noc" = ["py.typed", "**/*.j2"]
[tool.black]
line-length = 100 # Must be same as tool.ruff.line-length
target-version = ['py310']
[tool.coverage.run]
omit = ['*tests*']
[tool.coverage.report]
ignore_errors = true
[tool.coverage.html]
directory = "build/coverage"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [".git", "build", "dist", "var", "share", "collections", "node_modules", "ansible"]
line-length = 100 # Must be same as tool.black.line-length
# Assume Python 3.12
target-version = "py312"
# Always autofix, but never try to fix `F401` (unused imports).
fix = false #fix = true
[tool.ruff.lint]
ignore = [
"A001", # A001 Variable `{name}` is shadowing a python builtin
"A002", # A002 Argument `{name}` is shadowing a python builtin
"A003", # Class attribute `{name}` is shadowing a python builtin"
"A004", # Import `sum` is shadowing a Python builtin
"D203",
"D212",
"D107",
"PLR0912", # Too many branches
"PLR0911", # Too many return statements
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison, consider replacing {v} with a constant variable
"PLR1704", # @todo: Manual work! Redefining argument with the local name `name`
"RET503", # @todo: Manual work! Missing explicit `return` at the end of function able to return non-`None` value
"SIM102", # @todo: Investigate necessity of adding parenthesis! Use a single `if` statement instead of nested `if` statements
"SIM105", # @todo: After porting of the reports! Use `contextlib.suppress(KeyError)` instead of `try`-`except`-`pass`
"SIM108", # @todo: Controversal! Use ternary operator `mib_name = name[0].split("::", 1)[0] if isinstance(name, tuple) else name.split("::", 1)[0]` instead of `if`-`else`-block
"SIM112", # @todo: Not applicabile! Use capitalized environment variable `FTP_PROXY` instead of `ftp_proxy`
"SIM113", # @todo: Manual work! Use `enumerate()` for index variable `n` in `for` loop
"SIM114", # @todo: Controversal! Combine `if` branches using logical `or` operator
"SIM115", # @todo: We have a functions which are return handlers! Use a context manager for opening files
"SIM118", # @todo: Clashes with .keys() method! Use `key in dict` instead of `key in dict.keys()`
"PIE804", # @todo: After porting of reports! Unnecessary `dict` kwargs
"PIE810", # @todo: Enable after porting of reports! Call `startswith` once with a `tuple`
"PLC0206", # @todo: Manual work! Extracting value from dictionary without calling `.items()`
"PLC0415", # @todo: Not possible! `import` should be at the top-level of a file
"RUF001", # @todo: Occured in reports! String contains ambiguous `Т` (CYRILLIC CAPITAL LETTER TE). Did you mean `T` (LATIN CAPITAL LETTER T)?
"RUF006", # Store a reference to the return value of `asyncio.create_task`
"RUF009", # @todo: Manual work! Do not perform function call `Layout` in dataclass defaults
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF013", # PEP 484 prohibits implicit `Optional`
"RUF051", # @todo: ruff#20700 reported! Use `pop` instead of `key in dict` followed by `del dict[key]`
"RUF059", # Unpacked variable `epsilon` is never used
"RUF100", # Unused blanket `noqa` directive
]
# Enable
select = [
# "E", # Pycodestyle Error
"F", # Pyflakes
"W", # Pycodestyle Warning
# "C90", # mccabe
# "I", # isort
# "D", # Pydocstyle
"YTT", # flake8-2020
# "ANN", # flake8-annotations
# "S", # flake8-bandit
# "BLE", # flake8-blind-except
# "B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
# "EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
# "ICN", # flake8-import-conventions
"PT", # flake8-pytest-style
"RET", # flake8-return
"SIM", # flake8-simplify
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
# "PLW", # pylint
"PIE", # flake8-pie
"RUF", # ruff specific
]
unfixable = [
"F401",
"F841", # unused-variable
"F811", # Redefinition of unused `ReportBand` from line 66
"PLR1711", # Useless `return` statement at end of function # "F811", # Redefinition of unused `ReportBand` from line 66
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 12
[tool.ruff.lint.per-file-ignores]
"*/migrations/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
]
"cmibs/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
]
"tests/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"S101", # Use of assert detected
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PT011", # {exc} is to broad
]