Skip to content

Commit 1719d7e

Browse files
brentragerclaude
andcommitted
SMOODEV-1526: Fix Python ruff lint on ESO parity modules
Add the new eso_manifests + eso_refresher re-exports to __init__ __all__ (ruff F401 flagged them as unused since they weren't declared re-exports — the local pre-commit runs ruff format, not ruff check, so it slipped through and turned config main red). Also wrap three over-length lines (E501). src + tests clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ad2c77f commit 1719d7e

5 files changed

Lines changed: 32 additions & 7 deletions

File tree

python/src/smooai_config/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
init_container_config,
2323
select_mode,
2424
)
25+
from smooai_config.env_config import find_and_process_env_config
2526
from smooai_config.eso_manifests import (
2627
BootstrapSecretRef,
2728
ExternalSecretOptions,
@@ -36,7 +37,6 @@
3637
TokenSource,
3738
run_eso_refresher,
3839
)
39-
from smooai_config.env_config import find_and_process_env_config
4040
from smooai_config.file_config import find_and_process_file_config, find_config_directory
4141
from smooai_config.local import LocalConfigManager
4242
from smooai_config.merge import merge_replace_arrays
@@ -47,6 +47,7 @@
4747
__all__ = [
4848
"DEFAULT_CACHE_TTL_MS",
4949
"DEFAULT_TOKEN_REFRESH_BUFFER_SECONDS",
50+
"BootstrapSecretRef",
5051
"BuildBundleResult",
5152
"CloudRegionResult",
5253
"ConfigBootstrapError",
@@ -56,15 +57,22 @@
5657
"ConfigManager",
5758
"ConfigTier",
5859
"ContainerConfigHandle",
60+
"EsoRefresherHandle",
5961
"EvaluateFeatureFlagResponse",
62+
"ExternalSecretOptions",
6063
"FeatureFlagContextError",
6164
"FeatureFlagEvaluationError",
6265
"FeatureFlagNotFoundError",
6366
"LocalConfigManager",
67+
"SecretMapping",
68+
"SecretWriter",
6469
"SelectModeInputs",
6570
"SmooaiConfigError",
71+
"TokenSource",
6672
"UndefinedKeyError",
6773
"build_bundle",
74+
"build_cluster_secret_store",
75+
"build_external_secret",
6876
"build_config_runtime",
6977
"camel_to_upper_snake",
7078
"classify_from_schema",
@@ -79,5 +87,7 @@
7987
"init_container_config",
8088
"merge_replace_arrays",
8189
"read_baked_config",
90+
"resolve_secret_mapping",
91+
"run_eso_refresher",
8292
"select_mode",
8393
]

python/src/smooai_config/eso_manifests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def build_cluster_secret_store(
6464

6565
ref = bootstrap_secret or BootstrapSecretRef()
6666
base = api_url.rstrip("/")
67-
url = f"{base}/organizations/{org_id}/config/values/{{{{ .remoteRef.key }}}}?environment={quote(environment, safe='')}"
67+
env = quote(environment, safe="")
68+
url = f"{base}/organizations/{org_id}/config/values/{{{{ .remoteRef.key }}}}?environment={env}"
6869

6970
return {
7071
"apiVersion": ESO_API_VERSION,

python/src/smooai_config/eso_refresher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
from __future__ import annotations
1818

1919
import threading
20+
from collections.abc import Callable
2021
from dataclasses import dataclass
21-
from typing import Callable, Protocol
22+
from typing import Protocol
2223

2324
from smooai_config.utils import SmooaiConfigError
2425

python/tests/test_eso_manifests.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import pytest
6+
67
from smooai_config.eso_manifests import (
78
BootstrapSecretRef,
89
ExternalSecretOptions,
@@ -40,7 +41,8 @@ def test_cluster_secret_store_overrides():
4041
bootstrap_secret=BootstrapSecretRef(name="s", namespace="ns", key="k"),
4142
)
4243
assert store["metadata"]["name"] == "smooai-config-prod"
43-
assert store["spec"]["provider"]["webhook"]["secrets"][0]["secretRef"] == {"name": "s", "namespace": "ns", "key": "k"}
44+
ref = store["spec"]["provider"]["webhook"]["secrets"][0]["secretRef"]
45+
assert ref == {"name": "s", "namespace": "ns", "key": "k"}
4446

4547

4648
def test_cluster_secret_store_required_fields():
@@ -76,7 +78,12 @@ def test_build_external_secret_maps_keys():
7678

7779
def test_build_external_secret_distinct_target():
7880
es = build_external_secret(
79-
ExternalSecretOptions(name="litellm-config-eso", namespace="smooai-litellm", secrets=["mimoApiKey"], target_secret_name="litellm-config-eso")
81+
ExternalSecretOptions(
82+
name="litellm-config-eso",
83+
namespace="smooai-litellm",
84+
secrets=["mimoApiKey"],
85+
target_secret_name="litellm-config-eso",
86+
)
8087
)
8188
assert es["spec"]["target"]["name"] == "litellm-config-eso"
8289

python/tests/test_eso_refresher.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing import Callable
5+
from collections.abc import Callable
66

77
import pytest
8+
89
from smooai_config.eso_refresher import run_eso_refresher
910
from smooai_config.utils import SmooaiConfigError
1011

@@ -115,5 +116,10 @@ def test_required_fields():
115116

116117
def test_honors_interval_override():
117118
sched = ManualScheduler()
118-
run_eso_refresher(token_source=FakeTokenSource(["t"]), secret_writer=RecordingWriter(), interval_seconds=123.0, scheduler=sched)
119+
run_eso_refresher(
120+
token_source=FakeTokenSource(["t"]),
121+
secret_writer=RecordingWriter(),
122+
interval_seconds=123.0,
123+
scheduler=sched,
124+
)
119125
assert sched.interval == 123.0

0 commit comments

Comments
 (0)