Skip to content

Commit e601641

Browse files
msiebertclaude
andcommitted
Fix CI: exclude openfeature-provider from root lint and test collection
The openfeature-provider sub-project has its own pyproject.toml and dependencies. Root pytest was collecting its tests (failing on missing openfeature SDK), and root ruff was linting it without proper config. - Add --ignore=openfeature-provider to pytest addopts - Add extend-exclude for openfeature-provider in ruff config - Auto-format provider.py and test_provider.py with ruff Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 571af47 commit e601641

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

openfeature-provider/src/mixpanel_openfeature/provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def _resolve(
107107
fallback = SelectedVariant(variant_value=default_value)
108108
user_context = self._build_user_context(evaluation_context)
109109
try:
110-
result = self._flags_provider.get_variant(flag_key, fallback, user_context, report_exposure=True)
110+
result = self._flags_provider.get_variant(
111+
flag_key, fallback, user_context, report_exposure=True
112+
)
111113
except Exception:
112114
return FlagResolutionDetails(
113115
value=default_value,

openfeature-provider/tests/test_provider.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@ def provider(mock_flags):
2222

2323
def setup_flag(mock_flags, flag_key, value, variant_key="variant-key"):
2424
"""Configure mock to return a SelectedVariant with the given value."""
25-
mock_flags.get_variant.side_effect = lambda key, fallback, ctx, report_exposure=True: (
26-
SelectedVariant(variant_key=variant_key, variant_value=value)
27-
if key == flag_key
28-
else fallback
25+
mock_flags.get_variant.side_effect = (
26+
lambda key, fallback, ctx, report_exposure=True: (
27+
SelectedVariant(variant_key=variant_key, variant_value=value)
28+
if key == flag_key
29+
else fallback
30+
)
2931
)
3032

3133

3234
def setup_flag_not_found(mock_flags, flag_key):
3335
"""Configure mock to return the fallback (identity check triggers FLAG_NOT_FOUND)."""
34-
mock_flags.get_variant.side_effect = lambda key, fallback, ctx, report_exposure=True: fallback
36+
mock_flags.get_variant.side_effect = (
37+
lambda key, fallback, ctx, report_exposure=True: fallback
38+
)
3539

3640

3741
# --- Metadata ---
@@ -335,9 +339,7 @@ def test_forwards_attributes_flat(provider, mock_flags):
335339

336340
def test_forwards_full_context(provider, mock_flags):
337341
setup_flag(mock_flags, "flag", "val")
338-
ctx = EvaluationContext(
339-
targeting_key="user-456", attributes={"tier": "enterprise"}
340-
)
342+
ctx = EvaluationContext(targeting_key="user-456", attributes={"tier": "enterprise"})
341343
provider.resolve_string_details("flag", "default", ctx)
342344
_, _, user_context = mock_flags.get_variant.call_args[0]
343345
assert user_context == {

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ commands = [
6767

6868
[tool.pytest.ini_options]
6969
asyncio_mode = "auto"
70+
addopts = "--ignore=openfeature-provider"
7071

7172
# --- Ruff configuration (strict guide: select ALL, exclude explicitly) ---
7273

7374
[tool.ruff]
7475
target-version = "py39"
7576
line-length = 88
77+
extend-exclude = ["openfeature-provider"]
7678

7779
[tool.ruff.lint]
7880
select = ["ALL"]

0 commit comments

Comments
 (0)