Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add FeatureProvider protocol #268

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

federicobond
Copy link
Member

This PR introduces a new FeatureProvider protocol. Public API methods can use it as an argument type when they want to denote any provider, instead of AbstractProvider which is a bit clunky.

AbstractProvider remains as a provider base class for backward compatibility but it's import path at openfeature.provider.provider does not have the best ergonomics and we should begin working on a migration path before 1.0 is released.

@federicobond federicobond changed the title feat: add FeatureProvider interface feat: add FeatureProvider protocol Feb 2, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3b89760) 93.94% compared to head (ec6df50) 94.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
+ Coverage   93.94%   94.02%   +0.08%     
==========================================
  Files          16       17       +1     
  Lines         446      452       +6     
==========================================
+ Hits          419      425       +6     
  Misses         27       27              
Flag Coverage Δ
unittests 94.02% <100.00%> (+0.08%) ⬆️

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.

Copy link
Member

@gruebel gruebel left a comment

Choose a reason for hiding this comment

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

always love to see more usage of Protocol in Python projects

openfeature/provider/__init__.py Outdated Show resolved Hide resolved
Co-authored-by: Anton Grübel <[email protected]>
Signed-off-by: Federico Bond <[email protected]>
@federicobond federicobond merged commit caa7f36 into open-feature:main Feb 3, 2024
12 checks passed
@federicobond federicobond deleted the feature-provider branch February 3, 2024 14:26
Sign up for free to 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.

4 participants