feat(temporal): add support for temporalio#970
Open
bgener wants to merge 25 commits intotestcontainers:mainfrom
Open
feat(temporal): add support for temporalio#970bgener wants to merge 25 commits intotestcontainers:mainfrom
bgener wants to merge 25 commits intotestcontainers:mainfrom
Conversation
Closes testcontainers#926 by adding PEP-561 marker file `py.typed` Co-authored-by: Roy Moore <roy@moore.co.il>
Fixes testcontainers#992 ## Problem When `DOCKER_HOST` is set to an SSH URL (e.g. `ssh://user@remote-host`), the Docker Python SDK rewrites `base_url` to `http+docker://ssh`, losing the original hostname. This causes `DockerClient.host()` to return `"ssh"` instead of the actual remote address, breaking container connectivity. Additionally, the SDK defaults to paramiko for SSH connections, which crashes under pytest due to stdin capture conflicts. ## Changes ### `docker_client.py` - Extract the remote hostname from `DOCKER_HOST` in `host()` instead of relying on the SDK's rewritten `base_url` - Default to `use_ssh_client=True` for SSH connections to avoid paramiko/pytest stdin conflicts - Sanitize SSH URLs with unsupported path components before passing to the SDK - Add `get_docker_host_hostname()` and `is_ssh_docker_host()` helpers ### `compose.py` - Handle SSH in `PublishedPortModel.normalize()` — replace local bind addresses (`0.0.0.0`, `127.0.0.1`, etc.) with the remote SSH hostname ### Tests - Add SSH-specific tests for `DockerClient.host()`, connection mode, compose port normalization, and URL sanitization
…s#963) ## Summary Hello, this PR addresses the deprecation warning coming from `QdrantContainer`. The container currently uses the deprecated `@wait_container_is_ready()` decorator, which is scheduled for removal. This change migrates to the recommended `LogMessageWaitStrategy`. Additionally, the Qdrant Docker image version has been updated to match the Qdrant client version, resolving the following warning: `UserWarning: Qdrant client version 1.16.2 is incompatible with server version 1.13.5.` ## Testing All qdrant test cases passed: ```bash poetry run pytest modules/qdrant/tests/ -v ============== 4 passed, 3 warnings in 3.07s ============== ``` The remaining warnings are related to `UserWarning: Api key is used with an insecure connection.`, which is out of scope for this PR. Thank you for reviewing! --------- Co-authored-by: ethanlee <ethanlee@sebit.world> Co-authored-by: Roy Moore <roy@moore.co.il>
…ontainer_is_ready` (testcontainers#962) ### What was wrong? Decorator `wait_container_is_ready` is deprecated and raise `DeprecationWarning` Related issue: testcontainers#874 ### How it was fixed? Replace the deprecated `wait_container_is_ready` decorator with `HttpWaitStrategy` in the `ClickHouseContainer` Co-authored-by: Roy Moore <roy@moore.co.il>
…rs#939) Noticed a mismatch in a function docstring while using the library. Fixed return type of `get_service_port` from `str` to `int` Co-authored-by: Roy Moore <roy@moore.co.il>
…ainers#897) Summary This PR adds the ability to retrieve detailed container information from docker inspect in a structured format for ComposeContainer objects, with lazy loading and caching for optimal performance. Related with testcontainers#857 --------- Co-authored-by: Roy Moore <roy@moore.co.il>
…#849) py.typed marker added Co-authored-by: Roy Moore <roy@moore.co.il>
…ntainers#914) Another part of fixing testcontainers#874 (cf. testcontainers#899). --------- Co-authored-by: Dave Ankin <alexanderankin@gmail.com>
🤖 I have created a release *beep* *boop* --- ## [4.15.0-rc.1](testcontainers/testcontainers-python@testcontainers-v4.14.2...testcontainers-v4.15.0-rc.1) (2026-04-07) ### Features * **compose:** add structured container inspect information ([testcontainers#897](testcontainers#897)) ([58459a1](testcontainers@58459a1)) * **core:** support SSH-based DOCKER_HOST ([testcontainers#993](testcontainers#993)) ([d48115d](testcontainers@d48115d)) * **generic:** Reintroducing the generic SQL module ([testcontainers#892](testcontainers#892)) ([2ca2321](testcontainers@2ca2321)) * **keycloak:** support for relative path and management relative path ([testcontainers#982](testcontainers#982)) ([898faf6](testcontainers@898faf6)) * **mqtt:** MosquittoContainer: Add version 2.1.2 ([testcontainers#978](testcontainers#978)) ([af382f7](testcontainers@af382f7)) ### Bug Fixes * **azurite:** make visible to type checkers ([testcontainers#927](testcontainers#927)) ([baa5668](testcontainers@baa5668)) * **clickhouse:** add `HttpWaitStrategy` instead of deprecated `wait_container_is_ready` ([testcontainers#962](testcontainers#962)) ([8034541](testcontainers@8034541)) * **compose:** return type in get_service_port docstring ([testcontainers#939](testcontainers#939)) ([fed65fe](testcontainers@fed65fe)) * **core:** Refactor copy file ([testcontainers#996](testcontainers#996)) ([0e0bb24](testcontainers@0e0bb24)) * **core:** wait for ryuk more reliably, improve tests: long_running, filter logs ([testcontainers#984](testcontainers#984)) ([b12ae13](testcontainers@b12ae13)) * **generic:** Migrate ServerContainer from deprecated decorator to HttpWaitStrategy ([testcontainers#971](testcontainers#971)) ([460b0d8](testcontainers@460b0d8)) * **kafka:** Use wait strategy instead of deprecated wait_for_logs ([testcontainers#903](testcontainers#903)) ([87332c1](testcontainers@87332c1)) * **postgres:** add py.typed marker to postgres module ([testcontainers#849](testcontainers#849)) ([c8a5bbd](testcontainers@c8a5bbd)) * **qdrant:** migrate Qdrant from deprecated decorator. ([testcontainers#963](testcontainers#963)) ([407f798](testcontainers@407f798)) * **redis:** Use wait strategy instead of deprecated decorator ([testcontainers#914](testcontainers#914)) ([e25713a](testcontainers@e25713a)) * **sftp:** Avoid using wait_for_logs in module. ([testcontainers#995](testcontainers#995)) ([83157eb](testcontainers@83157eb)) --- 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: David Ankin <daveankin@gmail.com>
I’d like to add Valkey, the open-source fork of Redis, as a dedicated Testcontainers module. - Docker container: valkey/valkey:latest - Valkey website: https://valkey.io/ - Documentation: https://valkey.io/docs/ --------- Signed-off-by: Daria Korenieva <daric2612@gmail.com> Co-authored-by: Roy Moore <roy@moore.co.il>
…ainer_is_ready` (testcontainers#1003) ## Related - testcontainers#874 Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Bumps [authlib](https://github.com/authlib/authlib) from 1.6.6 to 1.6.9. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roy Moore <roy@moore.co.il>
…1006) Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.3 to 46.0.7. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst">cryptography's changelog</a>.</em></p> <blockquote> <p>46.0.7 - 2026-04-07</p> <pre><code> * **SECURITY ISSUE**: Fixed an issue where non-contiguous buffers could be passed to APIs that accept Python buffers, which could lead to buffer overflow. **CVE-2026-39892** * Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.5.6. <p>.. _v46-0-6:</p> <p>46.0.6 - 2026-03-25<br /> </code></pre></p> <ul> <li><strong>SECURITY ISSUE</strong>: Fixed a bug where name constraints were not applied to peer names during verification when the leaf certificate contains a wildcard DNS SAN. Ordinary X.509 topologies are not affected by this bug, including those used by the Web PKI. Credit to <strong>Oleh Konko (1seal)</strong> for reporting the issue. <strong>CVE-2026-34073</strong></li> </ul> <p>.. _v46-0-5:</p> <p>46.0.5 - 2026-02-10</p> <pre><code> * An attacker could create a malicious public key that reveals portions of your private key when using certain uncommon elliptic curves (binary curves). This version now includes additional security checks to prevent this attack. This issue only affects binary elliptic curves, which are rarely used in real-world applications. Credit to **XlabAI Team of Tencent Xuanwu Lab and Atuin Automated Vulnerability Discovery Engine** for reporting the issue. **CVE-2026-26007** * Support for ``SECT*`` binary elliptic curves is deprecated and will be removed in the next release. <p>.. v46-0-4:</p> <p>46.0.4 - 2026-01-27<br /> </code></pre></p> <ul> <li><code>Dropped support for win_arm64 wheels</code>_.</li> <li>Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.5.5.</li> </ul> <p>.. _v46-0-3:</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pyca/cryptography/commit/622d672e429a7cff836a23c5903683dbec1901f5"><code>622d672</code></a> 46.0.7 release (<a href="https://redirect.github.com/pyca/cryptography/issues/14602">#14602</a>)</li> <li><a href="https://github.com/pyca/cryptography/commit/91d728897bdad30cd5c79a2b23e207f1f050d587"><code>91d7288</code></a> Cherry-pick <a href="https://redirect.github.com/pyca/cryptography/issues/14542">#14542</a> (<a href="https://redirect.github.com/pyca/cryptography/issues/14543">#14543</a>)</li> <li><a href="https://github.com/pyca/cryptography/commit/06e120e682cb200e3f7050c02f0bcdac90c4c6ad"><code>06e120e</code></a> bump version for 46.0.5 release (<a href="https://redirect.github.com/pyca/cryptography/issues/14289">#14289</a>)</li> <li><a href="https://github.com/pyca/cryptography/commit/0eebb9dbb6343d9bc1d91e5a2482ed4e054a6d8c"><code>0eebb9d</code></a> EC check key on cofactor > 1 (<a href="https://redirect.github.com/pyca/cryptography/issues/14287">#14287</a>)</li> <li><a href="https://github.com/pyca/cryptography/commit/bedf6e186b814f69a3f54f51252c23a71d44ed2e"><code>bedf6e1</code></a> fix openssl version on 46 branch (<a href="https://redirect.github.com/pyca/cryptography/issues/14220">#14220</a>)</li> <li><a href="https://github.com/pyca/cryptography/commit/e6f44fc8e6391f05d719fb9d369692325b87a471"><code>e6f44fc</code></a> bump for 46.0.4 and drop win arm64 due to CI issues (<a href="https://redirect.github.com/pyca/cryptography/issues/14217">#14217</a>)</li> <li>See full diff in <a href="https://github.com/pyca/cryptography/compare/46.0.3...46.0.7">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/testcontainers/testcontainers-python/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/testcontainers/testcontainers-python/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR supports copying files into the container before startup time:
```python
DockerContainer("alpine")
.with_command(["cat", "/tmp/copied.txt"])
.with_copy_into_container(src, "/tmp/copied.txt")
```
To support this, I had to change how the container is started: `run` is
not longer used, but instead `create` and `start` are used now, in order
to be able to make the `copy` before the container is actually running.
Inspired by testcontainers/testcontainers-rs#730
where I did exactly the same feature for the rust implementation of
testcontainers :)
----
No tests are failing
```bash
> uv run pytest -v core/tests
...
======================================= 316 passed, 1 skipped in 160.87s (0:02:40) ========================================
```
Co-authored-by: David Ankin <daveankin@gmail.com>
Linked issue: testcontainers#865 This adds a Mongo DB Atlas local container. This works similarly to the Java container: https://java.testcontainers.org/modules/databases/mongodb/#mongodbatlaslocalcontainer Like the java one, I added this into the same module as the normal Mongo container, but we can make it into its own module if this would be better. Changes form standard mongo container: 1. Use different environment variables for configuration 2. Wait for the container healthcheck rather than the logs, as it takes a little longer for the search service to start. --------- Co-authored-by: Jeff Goddard <jeff.goddard+copilot@rbi.co.uk> Co-authored-by: Roy Moore <roy@moore.co.il> Co-authored-by: David Ankin <daveankin@gmail.com>
…ers#961) fixes testcontainers#808 partially resolve testcontainers#562, there may be some additional features requested there that this commit does not resolve. Additionally added test cases to check that it's picked up from env into config, and that the config changes the resolved image in DockerContainer Co-authored-by: David Ankin <daveankin@gmail.com>
🤖 I have created a release *beep* *boop* --- ## [4.15.0-rc2](testcontainers/testcontainers-python@testcontainers-v4.15.0-rc.1...testcontainers-v4.15.0-rc2) (2026-04-30) ### Features * **core:** support TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX ([testcontainers#961](testcontainers#961)) ([be9a0a6](testcontainers@be9a0a6)) * **mongodb:** Add Atlas Local for MongoDb ([testcontainers#873](testcontainers#873)) ([73aeb43](testcontainers@73aeb43)) * support with_copy_to ([testcontainers#976](testcontainers#976)) ([59ec1ce](testcontainers@59ec1ce)) * **valkey:** add Valkey module ([testcontainers#947](testcontainers#947)) ([fc09dc1](testcontainers@fc09dc1)) ### Bug Fixes * **azurite:** use `HttpWaitStrategy` instead of deprecated `wait_container_is_ready` ([testcontainers#1003](testcontainers#1003)) ([9fe6b07](testcontainers@9fe6b07)), closes [testcontainers#874](testcontainers#874) * fix pr [testcontainers#961](testcontainers#961) ([testcontainers#1011](testcontainers#1011)) ([8eff908](testcontainers@8eff908)) --- 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: David Ankin <daveankin@gmail.com>
…om/bgener/testcontainers-python into feature/implement-temporal-support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the new container you'd like to have?
https://temporal.io/ is a durable execution platform for running reliable, long-running workflows. The module wraps the https://hub.docker.com/r/temporalio/temporal docker image using the server start-dev command, which starts a lightweight all-in-one dev server with gRPC (7233), HTTP/Web UI (8233), and a preconfigured default namespace.
Why not just use a generic container for this?
A generic container ("temporalio/temporal:1.5.1") alone is not sufficient because:
Other references