Skip to content

refactor(typing): annotate self-returning methods with Self#1008

Open
ThanasisMattas wants to merge 3 commits into
testcontainers:mainfrom
ThanasisMattas:no-ticket/start-return-hint-Self
Open

refactor(typing): annotate self-returning methods with Self#1008
ThanasisMattas wants to merge 3 commits into
testcontainers:mainfrom
ThanasisMattas:no-ticket/start-return-hint-Self

Conversation

@ThanasisMattas
Copy link
Copy Markdown

No description provided.

@alexanderankin
Copy link
Copy Markdown
Member

we still support python 3.10, please change it back to typing_extensions and try to reduce the number of false test negatives so that i can focus on the other test failures - i think some are legitimate, and im not sure if they're specific to your branch.

@Tranquility2 Tranquility2 added the 🛠️ needs more work Need to invest more time, can be a rebase or code updates label May 29, 2026
@Tranquility2 Tranquility2 force-pushed the no-ticket/start-return-hint-Self branch from e94b5c8 to 7fa3ac5 Compare June 4, 2026 21:26
@Tranquility2 Tranquility2 changed the title No ticket: hint return type with Self when returning self refactor(typing): annotate self-returning methods with Self Jun 4, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.26%. Comparing base (be4c857) to head (7fa3ac5).

Files with missing lines Patch % Lines
core/testcontainers/core/generic.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1008      +/-   ##
==========================================
- Coverage   83.29%   83.26%   -0.03%     
==========================================
  Files          16       16              
  Lines        1754     1757       +3     
  Branches      193      193              
==========================================
+ Hits         1461     1463       +2     
- Misses        236      237       +1     
  Partials       57       57              

☔ 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.

@Tranquility2
Copy link
Copy Markdown
Contributor

Tranquility2 commented Jun 4, 2026

I rebased this branch onto main and added a fix-up commit so that Self is imported from typing_extensions (the project still supports Python 3.10, where typing.Self doesn't exist).
The original commits broke every 3.10 CI job; with this fix, all 3.10 core tests now pass.

The remaining red jobs on this PR are pre-existing issues unrelated to the Self refactor, which I've split out into focused PRs:

Once those land, this PR should go fully green after a rebase.

@Tranquility2 Tranquility2 added 👀 intend to merge this or some version of it and removed 🛠️ needs more work Need to invest more time, can be a rebase or code updates labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants