-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
148 lines (128 loc) · 4.62 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
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
[tool.poetry]
name = "infrahub_ansible_modules"
version = "1.4.2"
description = "Ansible collection to interact with Infrahub's API"
authors = ["OpsMill <[email protected]>"]
package-mode = false
license = "GPLv3"
[tool.poetry.dependencies]
python = ">=3.10,<3.13"
ansible-core = [
{ version = ">=2.15.13rc1", python = ">=3.9,<3.10" },
{ version = ">=2.17.7rc1", python = ">=3.10" },
]
infrahub-sdk = {version = ">=1.5, <2.0", extras = ["all"]}
jinja2 = ">=3.1.5"
[tool.poetry.group.dev.dependencies]
codecov = "*"
invoke = "^2.2.0"
ruff = "0.9.1"
mock = "^5.1.0"
pytest = "^8.3.4"
pytest-mock = "*"
pytest-xdist = "*"
pytest-pythonpath = "*"
ansible-lint = "^25.1.2"
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = [
"tests"
]
pythonpath = ["."]
[tool.ruff]
line-length = 120
exclude = [
".git",
".tox",
".venv",
"env",
"_build",
"build",
"dist",
"examples",
]
[tool.ruff.lint]
preview = true
task-tags = [
"FIXME",
"TODO",
"XXX",
]
select = ["ALL"]
ignore = [
"COM812", # missing-trailing-comma
"CPY", # flake8-copyright
"D", # pydocstyle
"DOC", # pydoclint
"ISC", # flake8-implicit-str-concat
"FBT", # flake8-boolean-trap
##################################################################################################
# Rules below needs to be Investigated #
##################################################################################################
"PT", # flake8-pytest-style
"PGH", # pygrep-hooks
"ERA", # eradicate commented-out code
"SLF001", # flake8-self
"EM", # flake8-errmsg
"TRY", # tryceratops
"TD", # flake8-todos
"FIX", # flake8-fixme
"TID", # flake8-tidy-imports
"G", # flake8-logging-format
"FLY", # flynt
"RSE", # flake8-raise
"BLE", # flake8-blind-except (BLE)
"A", # flake8-builtins
##################################################################################################
# The ignored rules below should be removed once the code has been updated, they are included #
# like this so that we can reactivate them one by one. Alternatively ignored after further #
# investigation if they are deemed to not make sense. #
##################################################################################################
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"C408", # Unnecessary `dict` call (rewrite as a literal)
"E402", # Module level import not at top of file
"INP001", # Is part of an implicit namespace package
"N806", # Variable in function should be lowercase
"PLC0415", # `import` should be at the top-level of a file
"PLR0912", # Too many branches
"PLR6201", # Use a `set` literal when testing for membership
"PLR6301", # Method could be a function, class method, or static method
"PLR1702", # Too many nested blocks
"PLR0913", # Too many arguments in function definition
"RET504", # Unnecessary assignment before `return` statement
]
[tool.ruff.lint.per-file-ignores]
"docs/**/*.py" = [
"ALL"
]
"plugins/**/*.py" = [
##################################################################################################
# Review and change the below later #
##################################################################################################
"ANN201", # ANN201 Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for special method
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"F404", # `from __future__` imports must occur at the beginning of the file
"UP001", # `__metaclass__ = type` is implied
"UP010", # Unnecessary `__future__` imports
]
"tasks/*.py" = [
"T201", # use of `print`
]
#https://docs.astral.sh/ruff/formatter/black/
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.isort]
known-first-party = ["infrahub"]
[tool.ruff.lint.pycodestyle]
max-line-length = 150
[tool.ruff.lint.mccabe]
# Target max-complexity=10
max-complexity = 33
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"