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

fix(core): Improving typing for common container usage scenarios #523

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

santi
Copy link
Collaborator

@santi santi commented Apr 2, 2024

Improves type hints for type checking in a common use cases:

with MySqlContainer("mysql:8").with_env("some", "value") as mysql:
    url = mysql.get_connection_url()  # get_connection_url would previously be an unknown member here

And, also improved type hinting for the custom DockerClient's run command, where the linter no longer reports an error due to missing parameter types:

DockerClient.run("nginx")  # Previously this would report "Argument missing for parameter "image"

Copy link
Collaborator

@alexanderankin alexanderankin left a comment

Choose a reason for hiding this comment

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

'spose

@alexanderankin
Copy link
Collaborator

linking #504 and #305

@santi santi merged commit d5b8553 into main Apr 3, 2024
8 checks passed
@santi santi deleted the feat/hot-path-type-improvements branch April 3, 2024 12:40
alexanderankin pushed a commit that referenced this pull request Apr 8, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.3.2](testcontainers-v4.3.1...testcontainers-v4.3.2)
(2024-04-08)


### Bug Fixes

* **core:** Improve typing for common container usage scenarios
([#523](#523))
([d5b8553](d5b8553))
* **core:** make config editable to avoid monkeypatching.1
([#532](#532))
([3be6da3](3be6da3))
* **vault:** add support for HashiCorp Vault container
([#366](#366))
([1326278](1326278))

---
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>
mloesch pushed a commit to mloesch/testcontainers-python that referenced this pull request Apr 8, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.3.2](testcontainers/testcontainers-python@testcontainers-v4.3.1...testcontainers-v4.3.2)
(2024-04-08)


### Bug Fixes

* **core:** Improve typing for common container usage scenarios
([testcontainers#523](testcontainers#523))
([d5b8553](testcontainers@d5b8553))
* **core:** make config editable to avoid monkeypatching.1
([testcontainers#532](testcontainers#532))
([3be6da3](testcontainers@3be6da3))
* **vault:** add support for HashiCorp Vault container
([testcontainers#366](testcontainers#366))
([1326278](testcontainers@1326278))

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

None yet

2 participants