-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
120 lines (101 loc) · 3.08 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
[project]
name = "ansibleinventorycmdb"
version = "1.0.1"
description = "Generates a CMDB webpage from an ansible git repository"
authors = [{ name = "Kieran Gee", email = "[email protected]" }]
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"flask>=3.1.0",
"pyyaml>=6.0.2",
"requests>=2.32.3",
"waitress>=3.0.2",
]
[dependency-groups]
dev = ["pyright"]
type = ["mypy", "types-colorama", "types-lxml", "types-requests"]
lint = ["ruff"]
test = [
"pytest",
"tomlkit",
"pytest-cov",
"pytest-mock",
"pytest-random-order",
"types-requests",
"types-pyyaml",
"detect-test-pollution",
"requests-mock",
]
[tool.uv]
default-groups = ["dev", "test", "type", "lint"]
[tool.ruff]
cache-dir = "~/.cache/ruff"
target-version = "py311"
line-length = 120
[tool.ruff.lint]
extend-fixable = ["B", "I001"] # KG I think this means something...
extend-unsafe-fixes = [
"F401",
] # KG I don't like that this is fixed automatically (this doesnt work?)
select = ["ALL"] # KG Include absolutely all of Ruff's rules.
ignore = [
# Modules
"DJ", # KG Django not required
"PTH", # KG builtin 'open' is fine, not going to use pathlib
"DTZ", # KG no need to specify timezone for time objects
# Specific rules
# "ANN101", # KG Why define self type for object functions...
"TD002", # KG Verbose TODO, only I work on this project
"TD003", # KG Verbose TODO, only I work on this project
"ISC001", # KG conflict in the formatter
"COM812", # KG conflict in the formatter
"G004", # KG Fine to log this way
"S301", # KG No user input, happy to use pickle
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
# Modules
"ARG", # KG Unused function args -> fixtures nevertheless are functionally relevant
"FBT", # KG Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
"ANN", # KG Don't care about annotations in tests
"D", # KG Don't care about docstrings in tests
# Specific rules
"S101", # KG asserts allowed in tests.
"SLF001", # KG Accessing private members is needed for testing.
"INP001", # KG __init__.py not needed for PyTest.
"PT004", # KG monkeypatches don't return.
"ANN001", # KG Tests don't need type hints.
"S311", # KG I'll assume no real crypto will be done in PyTest.
"BLE001", # KG BaseException is fine in tests
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
docstring-code-line-length = 40
[tool.pytest.ini_options]
addopts = [
"--cov-context=test",
"--cov=ansibleinventorycmdb",
"--cov-report=term",
"--cov-report=html",
]
testpaths = ["tests"]
[tool.coverage.html]
show_contexts = true
[tool.mypy]
files = ["ansibleinventorycmdb"]
namespace_packages = true
explicit_package_bases = true
show_error_codes = true
strict = false
enable_error_code = [
"ignore-without-code",
"redundant-expr",
"truthy-bool",
"type-arg",
]