Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
172 lines (159 loc) · 4.07 KB
/
Copy pathpyproject.toml
File metadata and controls
172 lines (159 loc) · 4.07 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
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
[project]
name = "discourse-k8s-operator"
version = "0.0.0"
description = "Discourse is the modern forum for your community."
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"cosl==1.11.3",
"dpcharmlibs-interfaces==1.2.2",
"jsonschema==4.26.0",
"ops==3.10.0",
"pydantic==2.12.5",
]
[dependency-groups]
fmt = [
"ruff",
]
lint = [
"boto3",
"bs4",
"codespell",
"jubilant==1.15.0",
"mypy",
"pep8-naming",
"psycopg2-binary",
"pytest",
"pytest-asyncio",
"pytest-operator",
"python-magic",
"requests",
"ruff",
"types-pyyaml",
"types-requests",
]
unit = [
"coverage[toml]",
"ops[testing]",
"pytest",
]
coverage-report = [
"coverage[toml]",
"pytest",
]
static = [
"bandit[toml]",
]
integration = [
"boto3",
"bs4",
"debugpy",
"jubilant==1.15.0",
"opcli ; python_version >= '3.12'",
"protobuf==7.36.0",
"psycopg2-binary",
"pytest",
"requests",
"saml-test-helper @ git+https://github.com/canonical/saml-test-idp.git",
]
[tool.uv]
package = false
[tool.uv.sources]
# opcli is published only from the charm-ci git repository, not PyPI.
opcli = { git = "https://github.com/canonical/charm-ci.git", tag = "v1.0.2" }
[tool.ruff]
target-version = "py310"
line-length = 99
# enable ruff linters:
# A flake8-builtins
# B flake8-bugbear
# CPY flake8-copyright
# D pydocstyle
# E/W pycodestyle
# F Pyflakes
# I isort
# N pep8-naming
# RUF Ruff-specific rules
# S flake8-bandit
# SIM flake8-simplify
# TC flake8-type-checking
# UP pyupgrade
lint.select = [ "A", "B", "C", "CPY", "D", "E", "F", "I", "N", "RUF", "S", "SIM", "TC", "UP", "W" ]
lint.ignore = [
"B904",
"D107",
"D203",
"D204",
"D205",
"D213",
"D215",
"D400",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
"E501",
"S105",
"S603",
"TC002",
"TC006",
"UP006",
"UP007",
"UP035",
"UP045",
]
lint.per-file-ignores."tests/*" = [ "B011", "D100", "D101", "D102", "D103", "D104", "D212", "D415", "D417", "S" ]
lint.flake8-copyright.author = "Canonical Ltd."
lint.flake8-copyright.min-file-size = 1
lint.flake8-copyright.notice-rgx = "Copyright\\s\\d{4}([-,]\\d{4})*\\s+"
lint.mccabe.max-complexity = 10
lint.pydocstyle.convention = "google"
[tool.codespell]
skip = "build,lib,venv,icon.svg,.tox,.git,.mypy_cache,.ruff_cache,.coverage,htmlcov,uv.lock,grafana_dashboards,*/docs/reuse/*,*/docs/_build/*"
[tool.pytest.ini_options]
minversion = "6.0"
log_cli_level = "INFO"
addopts = "-x"
pythonpath = [ "lib", "src" ]
# Turn warnings into errors so deprecations and resource leaks fail the unit
# suite rather than accumulating unnoticed. The ignore below is anchored to a
# specific message and is for third-party code; the charm's own code raises
# none. The legacy Harness tests carry a module-scoped ignore of their own
# (see tests/unit_harness/test_charm.py), and the integration env opts out
# (see tox.toml) because any warnings there come from the deployment tooling
# and are not this charm's to fix.
filterwarnings = [
"error",
# Raised by the vendored data_platform_libs charm lib; the fix belongs
# upstream in canonical/data-platform-libs.
"ignore:JujuVersion.from_environ\\(\\) is deprecated:DeprecationWarning",
# Raised by pydantic when importing dpcharmlibs-interfaces; the fix belongs
# upstream in canonical/data-platform-charmlibs.
"ignore:The '\\w+' attribute with value .* was provided to the `Field\\(\\)` function:pydantic.warnings.UnsupportedFieldAttributeWarning",
]
[tool.coverage.run]
branch = true
[tool.coverage.report]
fail_under = 80
show_missing = true
[tool.mypy]
ignore_missing_imports = true
explicit_package_bases = true
namespace_packages = true
check_untyped_defs = true
[tool.bandit]
exclude_dirs = [ "/venv/" ]
[tool.bandit.assert_used]
skips = [ "*tests/*.py" ]