Uh oh!
There was an error while loading. Please reload this page.
fix(core): Typing in docker_client - #702
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #702 +/- ##
=======================================
Coverage ? 84.97% =======================================
Files ? 12 Lines ? 679 Branches ? 106 =======================================
Hits ? 577 Misses ? 79 Partials ? 23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please note: core/testcontainers/core/config.py:46: error: X|YsyntaxforunionsrequiresPython3.10 [syntax]
connection_mode: str|None=environ.get("TESTCONTAINERS_CONNECTION_MODE")Found when rebasing and updated to support 3.9 (I'm not aware of deprecating 3.9 in tc-python, feel free to update) |
Tranquility2
commented
Dec 14, 2024
@alexanderankin@kiview can you please rerun this? (I assume this was an issue with the docker registry) |
CarliJoy
left a comment
There was a problem hiding this comment.
Please use cast only when required (i.e. for dict[str, Any]).
If possible always improve the runtime type safety.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| This is true for everything but bridge mode. | ||
| """ | ||
| if self == self.bridge_ip: | ||
| if cast(str, self) == self.bridge_ip: |
There was a problem hiding this comment.
Update to latest mypy, still the same behaviormypy 1.15.0 (compiled: yes)
There was a problem hiding this comment.
Found the issue :)
under "[tool.mypy]" on pyproject.toml
we have strict = true
I'll be adding # type: ignore[comparison-overlap] in the relevant locations (future PRs) @CarliJoy
There was a problem hiding this comment.
if self == ConnectionMode.bridge_ip:
Seems to be the type correct solution.
There was a problem hiding this comment.
Will fix after #807 as it also touch this part :)
f4b0d0a to
59372c6Compare@CarliJoy Updated with all of the Fixes |
0c70979 to
7b69f50Compare🤖 I have created a release *beep* *boop* --- ## [4.11.0](testcontainers-v4.10.0...testcontainers-v4.11.0) (2025-06-15) ### Features * **core:** Protocol support for container port bind and expose ([#690](#690)) ([a0d4317](a0d4317)) * DockerContainer initializer to accept its private members as kwargs ([#809](#809)) ([e7feb53](e7feb53)) ### Bug Fixes * **compose:** use provided docker command instead of default ([#785](#785)) ([0ae704a](0ae704a)) * **core:** Add kwargs to image build ([#708](#708)) ([cc02f94](cc02f94)) * **core:** change with_command type to include list of strings ([#789](#789)) ([f7c29cb](f7c29cb)) * **core:** Determine docker socket for rootless docker ([#779](#779)) ([6817582](6817582)) * **core:** Typing in docker_client ([#702](#702)) ([e8bf224](e8bf224)) * **core:** Typing in generic + network ([#700](#700)) ([2061912](2061912)) * **core:** Typing in version ([#701](#701)) ([9dc2a02](9dc2a02)) * **core:** wait in test core registry ([#812](#812)) ([b574c0e](b574c0e)) * **modules:** fix cosmosdb failure ([#827](#827)) ([dafcbed](dafcbed)) * **modules:** update chroma version ([#826](#826)) ([b7d41dd](b7d41dd)) * **rabbitmq:** correct pika pypi reference ([#817](#817)) ([e90d308](e90d308)) * **registry:** module typed ([#811](#811)) ([6b11268](6b11268)) * use connection mode override function in config ([#775](#775)) ([ab2a1ab](ab2a1ab)), closes [#774](#774) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Supports: #305
Related : #691#692#700
Based on #504, kudos @alexanderankin
Old
New