Skip to content

fix: fix cycle dependency between api and client - #480

Merged
gruebel merged 5 commits into
mainfrom
fix-imports
Apr 9, 2025
Merged

fix: fix cycle dependency between api and client#480
gruebel merged 5 commits into
mainfrom
fix-imports

Conversation

@gruebel

Copy link
Copy Markdown
Member

This PR

  • moved the api function related to hooks, evaluation context and transaction context to their dedicated module and re-exposed them, so there is no difference in the import statement, but now you can directly import them without needing to do it via openfeature.api
  • I didn't find a good way to make sure we don't this again. I know of importlinter which could help, but it doesn't work on the base of the namespace package.

Related Issues

Fixes#478

Signed-off-by: gruebel <anton.gruebel@gmail.com>

@imnotjamesimnotjames left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I grabbed the code from this PR and as far as I can tell it resolves the issue I was running into

Comment threadopenfeature/provider/_registry.py Outdated
@codecov

codecovBot commented Apr 7, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.44%. Comparing base (e61b69b) to head (2148972).
Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
openfeature/evaluation_context/__init__.py95.45%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #480 +/- ##
=======================================
Coverage 97.44% 97.44% =======================================
Files 37 37 Lines 1759 1761 +2 =======================================
+ Hits 1714 1716 +2 
Misses 45 45 
FlagCoverage Δ
unittests97.44% <97.87%> (+<0.01%)⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gruebel
gruebel requested review from a team as code ownersApril 9, 2025 06:22
@gruebel
gruebel merged commit 3636a0d into mainApr 9, 2025
@gruebel
gruebel deleted the fix-imports branch April 9, 2025 06:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Importing OpenFeatureClient leads to an error

4 participants

@gruebel@beeme1mr@imnotjames@aepfli