Skip to content

Conversation

@gruebel
Copy link
Member

@gruebel gruebel commented Jan 8, 2024

This PR

  • most of the type hint changes are pretty straight forward
  • one check of the strict checks is disabled to keep this PR rather small
  • changed a list-filter-lambda combo to a list comprehension, because mypy tripped on it and in general list comprehension are more performant compared to such a combo
  • also enabled mypy pretty mode, which gives quite nice error outputs
    ex.
openfeature/hook/hook_support.py:52: error: Missing type parameters for generic
type "Mapping"  [type-arg]
        hints: typing.Optional[typing.Mapping] = None,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (30f4e69) 93.83% compared to head (b833562) 93.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #257      +/-   ##
==========================================
+ Coverage   93.83%   93.84%   +0.01%     
==========================================
  Files          16       16              
  Lines         438      439       +1     
==========================================
+ Hits          411      412       +1     
  Misses         27       27              
Flag Coverage Δ
unittests 93.84% <100.00%> (+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.

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

@federicobond federicobond left a comment

Choose a reason for hiding this comment

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

Awesome work! LGTM

@federicobond
Copy link
Member

Apparently one of the lint rules for ruff conflicts with the mypy configuration:

openfeature/_backports/strenum.py:5:22: PLC0414 Import alias does not rename original package

@gruebel
Copy link
Member Author

gruebel commented Jan 8, 2024

@federicobond strange I thought I ran ruff multiple times 🤔 will ignore the rule in this specific line, because there is no other way I know to make both mypy and ruff happy. I prefer mypy to be happy 😄

gruebel and others added 2 commits January 9, 2024 00:01
@federicobond federicobond merged commit af9d3da into open-feature:main Jan 8, 2024
@gruebel gruebel deleted the improve-type-hints branch January 8, 2024 23:14
kikihakiem pushed a commit to ResalApps/openfeature-python-sdk that referenced this pull request Aug 28, 2025
…1.13 (open-feature#257)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

2 participants