Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
218 lines (197 loc) · 5.48 KB
/
Copy pathpyproject.toml
File metadata and controls
218 lines (197 loc) · 5.48 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
[project]
name = "vaultctl"
version = "1.5.0"
description = "Generalized Ansible Vault management CLI"
readme = "README.md"
authors = [
{ name = "cdds-ab", email = "info@cdds.de" }
]
requires-python = ">=3.13"
license = { text = "MIT" }
keywords = ["ansible", "vault", "secrets", "cli", "credentials"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Topic :: Security",
"Topic :: System :: Systems Administration",
"Environment :: Console",
]
dependencies = [
"click>=8.1",
"packaging>=26.0",
"pyyaml>=6.0",
]
[project.urls]
Homepage = "https://github.com/cdds-ab/vaultctl"
Documentation = "https://github.com/cdds-ab/vaultctl#readme"
Repository = "https://github.com/cdds-ab/vaultctl"
Issues = "https://github.com/cdds-ab/vaultctl/issues"
Changelog = "https://github.com/cdds-ab/vaultctl/releases"
[project.scripts]
vaultctl = "vaultctl.cli:main"
[build-system]
requires = ["uv_build>=0.8.17,<0.9.0"]
build-backend = "uv_build"
# Ruff configuration
[tool.ruff]
line-length = 120
target-version = "py313"
src = ["src/vaultctl", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"RUF", # ruff-specific rules
]
ignore = [
"E501", # line too long (handled by formatter)
"SIM117", # nested with statements - acceptable in tests for clarity
"TC001", # type-checking imports - runtime imports are simpler
"TC003", # type-checking imports for stdlib - runtime imports are simpler
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"ARG", # unused arguments are common in tests
"S101", # assert statements are OK in tests
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# MyPy configuration
[tool.mypy]
python_version = "3.13"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
check_untyped_defs = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_decorators = false
warn_return_any = false
[[tool.mypy.overrides]]
module = "yaml.*"
ignore_missing_imports = true
# Pytest configuration
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--showlocals",
"--cov=vaultctl",
"--cov-report=term-missing",
"--cov-fail-under=70",
]
[tool.coverage.run]
source = ["src/vaultctl"]
omit = [
"tests/*",
"src/vaultctl/self_update.py",
"src/vaultctl/__main__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if TYPE_CHECKING:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@abstractmethod",
]
# Bandit configuration
[tool.bandit]
exclude_dirs = ["tests", ".venv", "scripts"]
skips = ["B101", "B404", "B602", "B603", "B607"] # assert_used, import_subprocess, subprocess_with_shell_equals_true, subprocess_without_shell_equals_true, start_process_with_partial_path
# Commitizen configuration
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.1.0"
version_files = [
"pyproject.toml:version",
"src/vaultctl/__init__.py:__version__",
]
tag_format = "v$version"
update_changelog_on_bump = true
major_version_zero = true
# Semantic Release configuration
[tool.semantic_release]
version_variables = ["src/vaultctl/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"]
branch = "master"
upload_to_pypi = false
upload_to_release = true
hvcs = "github"
commit_message = "chore(release): bump version to {version}"
# Sync uv.lock with the new version inside the release commit so the lockfile
# never drifts behind pyproject.toml. The semantic-release action runs in a
# container without uv on PATH (exit 127 in the first attempt), hence the
# explicit `pip install uv` first. The explicit `git add` is needed because
# semantic-release only auto-stages files declared in version_variables /
# version_toml.
build_command = "pip install uv && uv lock && git add uv.lock"
[tool.semantic_release.commit_parser_options]
allowed_tags = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"style",
"refactor",
"test",
]
minor_tags = ["feat"]
patch_tags = ["fix", "perf", "style", "refactor"]
[tool.semantic_release.changelog]
exclude_commit_patterns = [
"^chore",
"^ci",
"^build",
"^style",
]
[tool.semantic_release.changelog.environment]
keep_trailing_newline = true
[dependency-groups]
dev = [
"pytest>=9.0",
"pytest-cov>=7.0",
"pytest-mock>=3.15",
"ruff>=0.15",
"mypy>=1.19",
"bandit>=1.9",
"commitizen>=4.13",
"pre-commit>=4.5",
"python-semantic-release>=10.4",
"radon>=6.0",
"types-pyyaml>=6.0",
"pyinstaller>=6.19",
]