Skip to content

Commit bd41711

Browse files
committed
Fix linting bugs
1 parent f4fe463 commit bd41711

4 files changed

Lines changed: 33 additions & 13 deletions

File tree

simvue/api/objects/events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@ def histogram(
204204
start point for event time range
205205
timestamp_end : datetime.datetime
206206
end point for event time range
207+
window : int
208+
the interval for metric aggregation
209+
filters : list[str] | None
210+
filters to apply to select on runs
207211
212+
Returns
213+
-------
214+
list[dict[str, str | int]]
215+
histogram response from server
208216
"""
209217
if timestamp_end - timestamp_begin <= datetime.timedelta(seconds=window):
210218
raise ValueError(

simvue/api/request.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def post(
8787
timeout for the request
8888
files : dict[str, Any] | None = None
8989
file data for this request
90+
verify : str | bool, optional
91+
whether to verify the request, if a string, the certificate
92+
to use for verification
9093
9194
Returns
9295
-------
@@ -163,6 +166,9 @@ def put(
163166
send as JSON string, by default True
164167
timeout : int, optional
165168
timeout of request, by default DEFAULT_API_TIMEOUT
169+
verify : str | bool, optional
170+
whether to verify the request, if a string, the certificate
171+
to use for verification
166172
167173
Returns
168174
-------
@@ -209,11 +215,12 @@ def put(
209215
)
210216
def get(
211217
url: str,
218+
*,
212219
headers: dict[str, str] | None = None,
213220
params: dict[str, str | int | float | None] | None = None,
214221
timeout: int = DEFAULT_API_TIMEOUT,
215-
verify: str | bool = True,
216222
json: dict[str, typing.Any] | None = None,
223+
verify: str | bool = True,
217224
) -> requests.Response:
218225
"""HTTP GET.
219226
@@ -229,6 +236,9 @@ def get(
229236
timeout of request, by default DEFAULT_API_TIMEOUT
230237
json : dict[str, Any] | None, optional
231238
any json to send in request
239+
verify : str | bool, optional
240+
whether to verify the request, if a string, the certificate
241+
to use for verification
232242
233243
Returns
234244
-------
@@ -238,12 +248,7 @@ def get(
238248
"""
239249
logger.debug("GET: %s\n\tparams=%s", url, params)
240250
response = requests.get(
241-
url,
242-
headers=headers,
243-
timeout=timeout,
244-
params=params,
245-
json=json,
246-
verify=verify
251+
url, headers=headers, timeout=timeout, params=params, json=json, verify=verify
247252
)
248253

249254
if response.status_code in RETRY_STATUSES:
@@ -268,10 +273,11 @@ def get(
268273
)
269274
def delete(
270275
url: str,
276+
*,
271277
headers: dict[str, str],
272278
timeout: int = DEFAULT_API_TIMEOUT,
273-
verify: str | bool = True,
274279
params: dict[str, typing.Any] | None = None,
280+
verify: str | bool = True,
275281
) -> requests.Response:
276282
"""HTTP DELETE.
277283
@@ -285,6 +291,9 @@ def delete(
285291
timeout of request, by default DEFAULT_API_TIMEOUT
286292
params : dict, optional
287293
parameters for deletion
294+
verify : str | bool, optional
295+
whether to verify the request, if a string, the certificate
296+
to use for verification
288297
289298
Returns
290299
-------
@@ -293,7 +302,9 @@ def delete(
293302
294303
"""
295304
logger.debug("DELETE: %s\n\tparams=%s", url, params)
296-
response = requests.delete(url, headers=headers, timeout=timeout, params=params, verify=verify)
305+
response = requests.delete(
306+
url, headers=headers, timeout=timeout, params=params, verify=verify
307+
)
297308

298309
if response.status_code in RETRY_STATUSES:
299310
raise RetryableHTTPError(

simvue/config/parameters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class CertificateSpecifications(pydantic.BaseModel):
2828
@pydantic.model_validator(mode="before")
2929
@classmethod
3030
def check_for_cert_env(
31-
cls, values: dict[str, pathlib.Path | None | str]
32-
) -> dict[str, pathlib.Path | None | str]:
31+
cls, values: dict[str, pathlib.Path | str | None]
32+
) -> dict[str, pathlib.Path | str | None]:
3333
"""Check for CA certificate for storage specification in environment."""
3434
if (
3535
_env_ca_cert := os.environ.get("SIMVUE_STORAGE_CA_CERTIFICATE")
@@ -38,7 +38,7 @@ def check_for_cert_env(
3838
if (_env_ca_cert := os.environ.get("SIMVUE_SERVER_CA_CERTIFICATE")) is not None:
3939
values["server_ca_cert"] = _env_ca_cert
4040
if _env_client_cert := os.environ.get("SIMVUE_SERVER_CLIENT_CERTIFICATE"):
41-
values["client_cert"] = _env_ca_cert
41+
values["client_cert"] = _env_client_cert
4242
return values
4343

4444

simvue/config/user.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ def _load_pyproject_configs(cls) -> dict | None:
122122
@functools.lru_cache
123123
def _check_server(
124124
cls,
125+
*,
125126
token: str,
126127
url: str,
127-
verify: str | bool,
128128
mode: typing.Literal["offline", "online", "disabled"],
129+
verify: str | bool,
129130
) -> semver.Version | None:
130131
if mode in {"offline", "disabled"}:
131132
return None

0 commit comments

Comments
 (0)