-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
158 lines (142 loc) · 4.4 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
149
150
151
152
153
154
155
156
157
158
[project]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
name = "rsp-reaper"
description = "Tool to remove certain OCI images from a repository"
license = { file = "LICENSE" }
readme = "README.md"
keywords = ["rubin", "lsst"]
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX",
"Typing :: Typed",
]
requires-python = ">=3.12"
# Use requirements/main.in for runtime dependencies instead.
dependencies = []
dynamic = ["version"]
[project.scripts]
cowbell = "rsp_reaper.cli:cowbell"
[project.urls]
Source = "https://github.com/lsst-sqre/rsp-reaper"
[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
[tool.black]
line-length = 79
target-version = ["py311"]
exclude = '''
/(
\.eggs
| \.git
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
)/
'''
# Use single-quoted strings so TOML treats the string like a Python r-string
# Multi-line strings are implicitly treated by black as regular expressions
[tool.coverage.run]
parallel = true
branch = true
source = ["rsp_reaper"]
[tool.coverage.paths]
source = ["src", ".tox/*/site-packages"]
[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.mypy]
disallow_untyped_defs = true
disallow_incomplete_defs = true
ignore_missing_imports = true
local_partial_types = true
no_implicit_reexport = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_ignores = true
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "strict"
filterwarnings = [
# Google modules call a deprecated pkg_resources API.
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
"ignore:.*pkg_resources\\.declare_namespace:DeprecationWarning",
]
# The python_files setting is not for test detection (pytest will pick up any
# test files named *_test.py without this setting) but to enable special
# assert processing in any non-test supporting files under tests. We
# conventionally put test support functions under tests.support and may
# sometimes use assert in test fixtures in conftest.py, and pytest only
# enables magical assert processing (showing a full diff on assert failures
# with complex data structures rather than only the assert message) in files
# listed in python_files.
python_files = [
"tests/*.py",
"tests/*/*.py",
]
# The rule used with Ruff configuration is to disable every lint that has
# legitimate exceptions that are not dodgy code, rather than cluttering code
# with noqa markers. This is therefore a reiatively relaxed configuration that
# errs on the side of disabling legitimate lints.
#
# Reference for settings: https://beta.ruff.rs/docs/settings/
# Reference for rules: https://beta.ruff.rs/docs/rules/
[tool.ruff]
extend = "ruff-shared.toml"
[tool.ruff.lint.per-file-ignores]
"src/rsp_reaper/models/rsptag.py" = [
"C901", # yes, compare() does have a lot of cases
]
"src/rsp_reaper/services/reaper.py" = [
"C901", # yes, RSP retention is complicated
"PLR0912", # yes, RSP retention is complicated
"T201", # Reporting uses print
]
"src/rsp_reaper/storage/gar.py" = [
"TRY004", # That's not even a TypeError
"ERA001", # It's a commented-out error message justifying the technique
]
"src/rsp_reaper/cli.py" = [
"T201", # Reporting uses print
]
"tests/**.py" = [
"SLF001", # Tests are allowed to access private members
"T201", # Tests are allowed to print
"S101", # Tests can use assert
]
"harnesses/**.py" = [
"T201", # Harnesses print during setup
]
[tool.ruff.lint.isort]
known-first-party = ["rsp_reaper", "tests", "harnesses"]
split-on-trailing-comma = false
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"fastapi.Form",
"fastapi.Header",
"fastapi.Depends",
"fastapi.Path",
"fastapi.Query",
]