-
Notifications
You must be signed in to change notification settings - Fork 102
/
pyproject.toml
244 lines (234 loc) · 5.76 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
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[project]
name = "juju"
version = "3.6.1.0" # Stop-gap until dynamic versioning is done; must be in sync with juju/version.py:CLIENT_VERSION
description = "Python library for Juju"
readme = "docs/readme.rst"
license = { file = "LICENSE" }
maintainers = [{name = "Juju Ecosystem Engineering", email = "[email protected]"}]
requires-python = ">=3.8.6"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
]
dependencies = [
"macaroonbakery>=1.1,<2.0",
"pyRFC3339>=1.0,<2.0",
"pyyaml>=5.1.2",
"websockets>=13.0.1",
"paramiko>=2.4.0",
"pyasn1>=0.4.4",
"toposort>=1.5,<2",
"typing_inspect>=0.6.0",
"kubernetes>=12.0.1,<31.0.0",
"hvac",
"packaging",
"typing-extensions>=4.5.0",
'backports.strenum>=1.3.1; python_version < "3.11"',
]
[project.optional-dependencies]
dev = [
"typing-inspect",
"pytest",
"pytest-asyncio",
"Twine",
"freezegun",
]
docs = [
"sphinx==5.3.0",
"sphinxcontrib-asyncio",
"sphinx_rtd_theme",
]
[project.urls]
"Homepage" = "https://juju.is/docs/sdk"
"Repository" = "https://github.com/juju/python-libjuju"
"Issues" = "https://github.com/juju/python-libjuju/issues"
"Documentation" = "https://pythonlibjuju.readthedocs.io/en/latest/"
"Changelog" = "https://pythonlibjuju.readthedocs.io/en/latest/changelog.html#changelog"
[tool.setuptools.dynamic]
version = {attr = "juju.version.CLIENT_VERSION"}
# Linting tools configuration
[tool.ruff]
target-version = "py38"
[tool.ruff.lint]
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I001",
# pep8-naming
"N",
# flake8-builtins
"A",
# flake8-copyright
"CPY",
# pyupgrade
"UP",
# flake8-2020
"YTT",
# flake8-bandit
"S",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# Ruff specific
"RUF",
# Perflint
"PERF",
# pyflakes-docstrings
"D",
]
ignore = [
# juju.secrets is a part of public API, can't rename or remove it now
"A005",
# FIXME: change the codegen to remove the schema from auto-generate classes
"RUF012",
# FIXME: change the codegen to insert a period at the end of the docstring
"D415",
# FIXME: quite a few mutable default arguments should be refactored
"B006",
# FIXME: raise from
"B904",
# FIXME: a bunch of missing docstrings
"D100",
"D101",
"D102",
"D103",
"D105",
"D107",
# FIXME: a bunch of docstrings without headlines
"D205",
# FIXME: manually rewrite docstring headlines to git on one line
"D400",
"D401",
# Some arguments are not documented
"D417",
# FIXME: run `uvx docformatter` to reformat docstrings
# Manual fixes are needed for string literals and f-strings
"E501",
# FIXME: there are some mixedCase members
"N815",
# Existing exception classes are part of the API, cannot rename now
"N818",
# try-except in a loop; hardly an issue in async functions
"PERF203",
# assert
"S101",
# subprocess module
"S404",
# FIXME: validate that we use yaml safely
"S506",
# FIXME: try/except: pass is OK
# Note: swallowing CancelledError is most likely a bug
"SIM105",
# FIXME: refactor if-else
"SIM108",
# % format is just fine
"UP031",
]
[tool.ruff.lint.per-file-ignores]
"juju/client/_*.py" = [
# Copyright
"CPY001",
# Codegen limitation: empty structs have empty docstrings.
"D419",
# CamelCase
"N802",
# star imports
"F403",
"F405",
# FIXME: undefined FacadeVersions...
# Is the class from _client.py intended?
# How does login even work?
"F821",
]
"examples/*" = [
# Docstring format
"D404",
]
"tests/*" = [
# assert False to fail
"B011",
# raise from
"B904",
# Don't require docstrings
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
# Copyright
"CPY001",
# Docstring format
"D205",
"D400",
# FIXME do something about long lines in assert v == "aaa..."
"E501",
# Performance overhead
"PERF203",
# async function without await
"RUF029",
# index[0]
"RUF015",
# Allow asserts
"S101",
# Hardcoded passwords and secret keys
"S105",
"S106",
# FIXME Hardcoded /tmp path, prevents parallel tests
"S108",
# Weird URL scheme
"S310",
# Weak random source
"S311",
# subprocess
"S404",
"S603",
"S607",
# FIXME YAML loader
"S506",
# FIXME refactor nested if statements
"SIM102",
# FIXME refactor nested with statements
"SIM117",
# FIXME refactor to use list comprehensions
"PERF401",
# FIXME new-style super()
"UP008",
# %-format
"UP031",
]
[tool.pyright]
# These are tentative
include = ["**/*.py"]
pythonVersion = "3.8.6"
# FIXME understand the difference
#typeCheckingMode = "strict"
#useLibraryCodeForTypes = true
reportGeneralTypeIssues = true
[tool.pytest.ini_options]
addopts = "-ra -v"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
filterwarnings = "ignore::DeprecationWarning:websockets"
markers = [
"serial: mark a test that must run by itself",
"wait_for_idle: mark a test that waits for the model to be idle",
"bundle: mark a test that uses a bundle",
]