Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
223 lines (206 loc) · 5.16 KB
/
Copy pathpyproject.toml
File metadata and controls
223 lines (206 loc) · 5.16 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
[project]
name = "borescope"
version = "1.1.0"
description = "A natural shell for debugging Juju Kubernetes workload containers via Pebble"
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
authors = [
{name = "Tony Meyer", email = "borescope@aotearoa.dev"},
]
keywords = ["juju", "pebble", "kubernetes", "charm", "shell", "debugging"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
]
dependencies = [
"ops>=2.0.0,<4",
"pebble-shimmer>=1.0.0",
"prompt_toolkit>=3.0",
"PyYAML>=6.0",
]
[dependency-groups]
dev = [
"atheris>=2.3.0",
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.10.0",
"ruff==0.17.4",
"ty==0.0.98",
"pre-commit>=3.0.0",
"zizmor>=1.28.0",
]
docs = [
"jinja2>=3.1",
"markdown-it-py>=3.0",
"mdit-py-plugins>=0.4",
"PyYAML>=6.0",
]
[project.scripts]
borescope = "borescope.cli:main"
[project.urls]
Homepage = "https://github.com/tonyandrewmeyer/borescope"
Repository = "https://github.com/tonyandrewmeyer/borescope"
"Bug Tracker" = "https://github.com/tonyandrewmeyer/borescope/issues"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/borescope"]
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/README.md",
"/LICENSE",
]
# Ruff configuration
[tool.ruff]
line-length = 99
target-version = "py311"
src = ["src", "tests"]
[tool.ruff.format]
quote-style = "single"
[tool.ruff.lint]
# CPY (flake8-copyright) currently requires preview mode.
preview = true
explicit-preview-rules = true
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I001",
# pep8-naming
"N",
# flake8-builtins
"A",
# flake8-copyright
"CPY001",
# pyupgrade
"UP",
# flake8-2020
"YTT",
# flake8-bandit
"S",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# Ruff-specific
"RUF",
# Perflint
"PERF",
# pydocstyle
"D",
# flake8-future-annotations
"FA",
# flake8-type-checking
"TC",
]
ignore = [
# Line too long: handled by the formatter.
"E501",
# Don't force imports into TYPE_CHECKING blocks.
"TC001",
"TC002",
"TC003",
# assert is fine.
"S101",
# Magic methods and __init__ don't need docstrings.
"D105",
"D107",
# subprocess call: check for execution of untrusted input. False-positive heavy.
"S603",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["id", "min", "map", "range", "type", "input", "format", "exit", "help"]
[tool.ruff.lint.flake8-copyright]
notice-rgx = "(?i)Copyright \\d{4} Tony Meyer"
[tool.ruff.lint.per-file-ignores]
# Command classes are self-documenting via their ``name``/``summary``/``usage``
# attributes; a docstring would only restate ``summary``.
"src/borescope/shell/commands/*.py" = [
"D101",
"D102",
]
# Transport is a structural ``Protocol`` mirroring ``ops.pebble.Client``; the
# upstream API is the docstring.
"src/borescope/transport/__init__.py" = [
"D102",
]
"tests/*" = [
# Docstrings aren't required in tests.
"D",
# Hard-coded "secrets" are fine in tests.
"S105",
"S106",
# Fixed /tmp paths are fine in tests: they are never created, only passed
# to the transport under test as opaque remote paths.
"S108",
]
"tests/**/*" = [
"D",
"S105",
"S106",
"S108",
]
# The docs build script intentionally keeps two things ruff would flag:
"docs/src/_build.py" = [
# The entity-rewrite table maps literal "ambiguous" Unicode characters
# (en dash, curly quotes, ...) to HTML entities — they must stay as-is.
"RUF001",
# Jinja2 autoescape is deliberately off: the body is trusted, already-
# rendered HTML, and escaping it would double-encode the docs.
"S701",
]
[tool.ruff.lint.isort]
known-first-party = ["borescope"]
# Pytest configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"--strict-markers",
"--strict-config",
]
testpaths = ["tests"]
markers = [
"integration: marks tests that require a real pebble binary (deselect with '-m \"not integration\"')",
"requires_juju: marks tests that require a live Juju controller",
]
[tool.coverage.run]
source = ["src"]
branch = true
omit = [
"tests/*",
"*/__pycache__/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if False:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
"if TYPE_CHECKING:",
]
show_missing = true
precision = 2