Skip to content

Fix mypy errors with tenacity 9.2 - #624

Merged
leszekhanusz merged 1 commit into
graphql-python:masterfrom
leszekhanusz:fix_tenacity_9_2_typing
Dec 4, 2026
Merged

leszekhanusz merged 1 commit into
graphql-python:masterfrom
leszekhanusz:fix_tenacity_9_2_typing

Conversation

@leszekhanusz

Copy link
Copy Markdown
Collaborator

make check fails with tenacity 9.2.1 because mypy reports 4 errors in gql/client.py.

In that release, the decorator returned by retry(...) is typed as returning a _RetryDecorated protocol instead of the type of the function it receives. mypy inferred the types of self.retry_connect and self.retry_execute from the retry(...) assignments, so the lambda e: e used when retries are disabled no longer matched.

This PR explicitly annotates both attributes as _Decorator, the type already used for the constructor parameters. There is no change in runtime behaviour.

mypy passes with tenacity 9.1.2, 9.1.4 and 9.2.1, so the version range in setup.py is unchanged.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7fb869a) to head (7266e70).
⚠️ Report is 80 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #624    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           38        40     +2     
  Lines         2908      3331   +423     
==========================================
+ Hits          2908      3331   +423     

☔ View full report in Codecov by Harness.
📢 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.

@leszekhanusz
leszekhanusz merged commit 4cc989a into graphql-python:master Dec 4, 2026
16 checks passed
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.

1 participant