Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a933873
feat: reusable containers
matthiasschaub Jul 2, 2024
f0e2bc7
docs: add documentation about reusable containers
matthiasschaub Jul 3, 2024
08e33ba
test: additional testcase for reusable containers
matthiasschaub Jul 3, 2024
d2a83bc
test: add newlines for better readability
matthiasschaub Jul 3, 2024
c781606
warn user if ryuk is disabled but with_reuse used
matthiasschaub Jul 3, 2024
dd429e7
docs: fix code highlighting
matthiasschaub Jul 3, 2024
e87e782
fix: use Union instead of | for type hint
matthiasschaub Jul 7, 2024
c656660
refactor: remove TODO comment
matthiasschaub Jul 8, 2024
efb1265
docs: update section on reusable containers
matthiasschaub Jul 8, 2024
d4445d6
feat(reuse): do not change contract of stop method
matthiasschaub Aug 2, 2024
1ea9ed1
feat(reuse): do not create Ryuk cleanup instance
matthiasschaub Aug 2, 2024
ea6fec7
refactor: move hash generation into if clause
matthiasschaub Aug 3, 2024
7c1e8e7
Merge remote-tracking branch 'origin/main' into reusable_containers
matthiasschaub Dec 30, 2024
78b137c
fix: milvus healthcheck: use correct requests errors (#759)
alexanderankin Jan 21, 2025
9317736
chore(main): release testcontainers 4.9.1 (#748)
github-actions[bot] Jan 21, 2025
3e783a8
fix(core): multiple container start invocations with custom labels (#…
neykov Feb 11, 2025
f0bb0f5
docs: Fixed typo in CONTRIBUTING.md (#767)
max-pfeiffer Feb 11, 2025
b1642e9
fix(keycloak): Fixed Keycloak testcontainer for latest version v26.1.…
max-pfeiffer Feb 11, 2025
2113561
Merge branch 'main' into reusable_containers
matthiasschaub Feb 12, 2025
2620d7f
fix: Change env var disabling OpenSearch security plugin (#773)
oelhammouchi Feb 22, 2025
7517297
fix(core): create_label test (#771)
neykov Feb 24, 2025
46913c1
fix(scylla): scylla get cluster method (#778)
alexanderankin Feb 26, 2025
a0785d7
chore(main): release testcontainers 4.9.2 (#770)
github-actions[bot] Mar 5, 2025
f979525
fix(security): Update track-modules job (#787)
Tranquility2 Mar 17, 2025
2f9139c
feat: Add SocatContainer (#795)
eddumelendez Apr 1, 2025
9497a45
fix(ollama): make device request a list (#799)
alexanderankin Apr 2, 2025
46feb1e
chore(main): release testcontainers 4.10.0 (#798)
github-actions[bot] Apr 2, 2025
6817582
fix(core): Determine docker socket for rootless docker (#779)
CarliJoy Apr 2, 2025
f7c29cb
fix(core): change with_command type to include list of strings (#789)
AmirHosein-Gharaati Apr 2, 2025
ab2a1ab
fix: use connection mode override function in config (#775)
alexanderankin Apr 2, 2025
cc02f94
fix(core): Add kwargs to image build (#708)
Tranquility2 Apr 2, 2025
0ae704a
fix(compose): use provided docker command instead of default (#785)
AmirHosein-Gharaati Apr 2, 2025
e9e40f9
chore: update poetry version for more reliable docs build (#803)
alexanderankin Apr 3, 2025
0615c29
Merge branch 'main' into reusable_containers
matthiasschaub Apr 16, 2025
a0d4317
feat(core): Protocol support for container port bind and expose (#690)
Tranquility2 May 4, 2025
2061912
fix(core): Typing in generic + network (#700)
Tranquility2 May 4, 2025
9dc2a02
fix(core): Typing in version (#701)
Tranquility2 May 4, 2025
e8bf224
fix(core): Typing in docker_client (#702)
Tranquility2 May 4, 2025
408f5c2
chore(main): project fixes and updates (#807)
Tranquility2 May 4, 2025
23e436a
Merge branch 'main' into reusable_containers
matthiasschaub May 14, 2025
2bfb36d
fix: revert accidental removal of @property
matthiasschaub May 27, 2025
e7feb53
feat: DockerContainer initializer to accept its private members as kw…
rhoban13 May 29, 2025
5f34ad0
chore: Updating docker version in CI (#821)
terry-docker Jun 4, 2025
dafcbed
fix(modules): fix cosmosdb failure (#827)
terry-docker Jun 13, 2025
3b9e8e4
test(modules): Adds postgres test ensure both drivers are compatible …
terry-docker Jun 13, 2025
b7d41dd
fix(modules): update chroma version (#826)
terry-docker Jun 13, 2025
16fb2b2
chore: Update pyproject and tests to support Mac's/arm local developm…
terry-docker Jun 13, 2025
b702918
chore: Use 'latest' tag for Qdrant module (#815)
w1am Jun 15, 2025
e90d308
fix(rabbitmq): correct pika pypi reference (#817)
emmanuel-ferdman Jun 15, 2025
6b11268
fix(registry): module typed (#811)
Tranquility2 Jun 15, 2025
b574c0e
fix(core): wait in test core registry (#812)
Tranquility2 Jun 15, 2025
632e5f4
chore(main): release testcontainers 4.11.0 (#800)
github-actions[bot] Jun 16, 2025
a6bdf0e
feat(main): New Testcontainers Python Docs Site (#822)
terry-docker Jun 18, 2025
bc86a3e
Add mkdocs dependencies
eddumelendez Jun 18, 2025
f467c84
fix: just use the getLogger API and do not override logger settings (…
alexanderankin Jun 19, 2025
ff6a32d
feat: make config monkeypatchable, fix config related startup issues …
CarliJoy Jun 23, 2025
b816762
fix(core): mypy (#810)
alexanderankin Jul 2, 2025
d749fc6
docs: missing compose html from old docs (#776)
alexanderankin Jul 2, 2025
1532df5
feat: set multiple variables via keyword args (#804)
jeeger Jul 2, 2025
ef65bd1
fix: Enable mypy in the CI (#842)
Tranquility2 Jul 3, 2025
0b7b482
feat(modules): add OpenFGA module (#762)
giggsoff Jul 21, 2025
d40473f
chore(main): release testcontainers 4.12.0 (#834)
github-actions[bot] Jul 21, 2025
6796a9a
Merge remote-tracking branch 'testcontainers/main' into reusable_cont…
matthiasschaub Jul 31, 2025
003046b
feat(core): Wait strategies foundation (#838)
terry-docker Aug 6, 2025
a072f3f
fix(core): Make TC_POOLING_INTERVAL/sleep_time a float (#839)
samuelhwilliams Aug 7, 2025
fe206eb
feat(core): DockerCompose: support list of env_files (#847)
mavcook Aug 8, 2025
fc4155e
fix: assert-in-get_container_host_ip-before-start (#862)
alexanderankin Aug 19, 2025
b21e5e3
feat(azurite): Enhance connection string generation for network and l…
adendek Aug 25, 2025
350f246
fix(core): improper reading of .testcontainers.properties (#863)
laundry-96 Aug 27, 2025
60d21f8
feat(core): add enhanced wait strategies (#855)
terry-docker Aug 27, 2025
504957b
chore(main): release testcontainers 4.13.0 (#858)
github-actions[bot] Sep 9, 2025
aa47435
chore: add support for building with python 3.13 (#871)
axel7083 Sep 9, 2025
3050fee
Merge remote-tracking branch 'testcontainers/main' into reusable_cont…
matthiasschaub Sep 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.9.0"
".": "4.13.0"
}
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You need to have the following tools available to you:
- Run `make install` to get `poetry` to install all dependencies and set up `pre-commit`
- **Recommended**: Run `make` or `make help` to see other commands available to you.
- After this, you should have a working virtual environment and proceed with writing code with your favourite IDE
- **TIP**: You can run `make core/tests` or `make module/<my-module>/tests` to run the tests specifically for that to speed up feedback cycles
- **TIP**: You can run `make core/tests` or `make modules/<my-module>/tests` to run the tests specifically for that to speed up feedback cycles
- You can also run `make lint` to run the `pre-commit` for the entire codebase.


Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ jobs:
- name: Checkout contents
uses: actions/checkout@v4
with:
fetch-depth: 0 # recommended by tj-actions/changed-files
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
with:
path: "./modules"
diff_relative: true
dir_names: true
dir_names_exclude_current_dir: true
json: true
base: ${{ github.ref }}
list-files: 'json'
filters: |
modules:
- 'modules/**'
- name: Compute modules from files
id: compute-changes
run: |
modules=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | jq '.[] | split("/") | first' | jq -s -c '. | unique')
modules=$(echo "${{ toJson(steps.changed-files.outputs.modules_files) }}" | jq '.[] | split("/") | nth(1)' | jq -s -c '. | unique')
echo "computed_modules=$modules"
echo "computed_modules=$modules" >> $GITHUB_OUTPUT
outputs:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contrinuous Integration for the core package
# Continuous Integration for the core package

name: core

Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -25,6 +25,8 @@ jobs:
run: poetry install --all-extras
- name: Run twine check
run: poetry build && poetry run twine check dist/*.tar.gz
- name: Set up Docker
uses: docker/setup-docker-action@v4
- name: Run tests
run: make core/tests
- name: Rename coverage file
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@ jobs:
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Execute pre-commit handler
run: poetry run pre-commit run -a
continue-on-error: true
run: |
poetry run pre-commit run check-toml
poetry run pre-commit run trailing-whitespace
poetry run pre-commit run end-of-file-fixer
poetry run pre-commit run ruff
poetry run pre-commit run ruff-format
- name: Execute mypy
run: |
make mypy-core-report
make mypy-core
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ venv
.python-version
.env
.github-token

# docs build
site/
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.5'
rev: 'v0.11.5'
hooks:
- id: ruff
# Explicitly setting config to prevent Ruff from using `pyproject.toml` in sub packages.
args: [ '--fix', '--exit-non-zero-on-fix', '--config', 'pyproject.toml' ]
- id: ruff-format
args: [ '--config', 'pyproject.toml' ]

# - repo: local
# hooks:
# - id: mypy
# name: mypy
# entry: poetry run mypy
# args: ["--config-file", "pyproject.toml"]
# files: "core" # start with the core being type checked
# language: system
# types: [ python ]
# require_serial: true
- repo: local
hooks:
- id: mypy
name: mypy
entry: poetry run mypy
args: ["--config-file", "pyproject.toml"]
files: "core" # start with the core being type checked
language: system
types: [ python ]
require_serial: true
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ build:
# https://github.com/readthedocs/readthedocs.org/issues/4912#issuecomment-1143587902s
jobs:
post_install:
- pip install poetry==1.7.1 # match version from poetry.lock
- pip install poetry==2.1.2 # match version from poetry.lock
- poetry config virtualenvs.create false
- poetry install --all-extras
101 changes: 101 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,106 @@
# Changelog

## [4.13.0](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.12.0...testcontainers-v4.13.0) (2025-08-27)


### Features

* **azurite:** Enhance connection string generation for network and local access ([#859](https://github.com/testcontainers/testcontainers-python/issues/859)) ([b21e5e3](https://github.com/testcontainers/testcontainers-python/commit/b21e5e38075ddbd71fb4f97e843abc104dec6beb))
* **core:** add enhanced wait strategies ([#855](https://github.com/testcontainers/testcontainers-python/issues/855)) ([60d21f8](https://github.com/testcontainers/testcontainers-python/commit/60d21f875f49f52e170b0714e8790080a6cb4c71))
* **core:** DockerCompose: support list of env_files ([#847](https://github.com/testcontainers/testcontainers-python/issues/847)) ([fe206eb](https://github.com/testcontainers/testcontainers-python/commit/fe206eb48ee9e18623761926900bfc33a8a869a7))


### Bug Fixes

* assert-in-get_container_host_ip-before-start ([#862](https://github.com/testcontainers/testcontainers-python/issues/862)) ([fc4155e](https://github.com/testcontainers/testcontainers-python/commit/fc4155eb70509ba236fff771c2f8973667acb098))
* **core:** improper reading of .testcontainers.properties ([#863](https://github.com/testcontainers/testcontainers-python/issues/863)) ([350f246](https://github.com/testcontainers/testcontainers-python/commit/350f246a3b6367d727046b8967a63d1c055cf324))
* **core:** Make TC_POOLING_INTERVAL/sleep_time a float ([#839](https://github.com/testcontainers/testcontainers-python/issues/839)) ([a072f3f](https://github.com/testcontainers/testcontainers-python/commit/a072f3fad46b3b3e7c5bea6255f27b79826aaf5f))

## [4.12.0](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.11.0...testcontainers-v4.12.0) (2025-07-21)


### Features

* **main:** New Testcontainers Python Docs Site ([#822](https://github.com/testcontainers/testcontainers-python/issues/822)) ([a6bdf0e](https://github.com/testcontainers/testcontainers-python/commit/a6bdf0ef84643074fbc7edf3a75936ce3f1d0880))
* make config monkeypatchable, fix config related startup issues ([#833](https://github.com/testcontainers/testcontainers-python/issues/833)) ([ff6a32d](https://github.com/testcontainers/testcontainers-python/commit/ff6a32db803046db8d89ba5a7157bf573d9f25c2))
* **modules:** add OpenFGA module ([#762](https://github.com/testcontainers/testcontainers-python/issues/762)) ([0b7b482](https://github.com/testcontainers/testcontainers-python/commit/0b7b482f9ec807e87fd43d1372226fa43eb4ed7c))
* set multiple variables via keyword args ([#804](https://github.com/testcontainers/testcontainers-python/issues/804)) ([1532df5](https://github.com/testcontainers/testcontainers-python/commit/1532df5e9094d15b9f3e9233e7f5843d8bc24386))


### Bug Fixes

* **core:** mypy ([#810](https://github.com/testcontainers/testcontainers-python/issues/810)) ([b816762](https://github.com/testcontainers/testcontainers-python/commit/b816762b9a548033b065c3f46267c289a560f6ed))
* Enable mypy in the CI ([#842](https://github.com/testcontainers/testcontainers-python/issues/842)) ([ef65bd1](https://github.com/testcontainers/testcontainers-python/commit/ef65bd113b564bce614aaf6df13bbf5339b9bc58))
* just use the getLogger API and do not override logger settings ([#836](https://github.com/testcontainers/testcontainers-python/issues/836)) ([f467c84](https://github.com/testcontainers/testcontainers-python/commit/f467c842b851613b9a087bd5f9a08d8c39577cb8))


### Documentation

* missing compose html from old docs ([#776](https://github.com/testcontainers/testcontainers-python/issues/776)) ([d749fc6](https://github.com/testcontainers/testcontainers-python/commit/d749fc69b32715742d834c003ee6893e2077753a))

## [4.11.0](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.10.0...testcontainers-v4.11.0) (2025-06-15)


### Features

* **core:** Protocol support for container port bind and expose ([#690](https://github.com/testcontainers/testcontainers-python/issues/690)) ([a0d4317](https://github.com/testcontainers/testcontainers-python/commit/a0d4317643005dde4f344eccbfc56c062e83bf05))
* DockerContainer initializer to accept its private members as kwargs ([#809](https://github.com/testcontainers/testcontainers-python/issues/809)) ([e7feb53](https://github.com/testcontainers/testcontainers-python/commit/e7feb53fe532b6d32d5d0c5a5d517249f8e7de50))


### Bug Fixes

* **compose:** use provided docker command instead of default ([#785](https://github.com/testcontainers/testcontainers-python/issues/785)) ([0ae704a](https://github.com/testcontainers/testcontainers-python/commit/0ae704a24de440b715d5f3c11eaa4f18ccd437b5))
* **core:** Add kwargs to image build ([#708](https://github.com/testcontainers/testcontainers-python/issues/708)) ([cc02f94](https://github.com/testcontainers/testcontainers-python/commit/cc02f9444b41efa62836b21210b07aee1da94d0b))
* **core:** change with_command type to include list of strings ([#789](https://github.com/testcontainers/testcontainers-python/issues/789)) ([f7c29cb](https://github.com/testcontainers/testcontainers-python/commit/f7c29cb913e4d42d535783c3aa0f3566d4e543bf))
* **core:** Determine docker socket for rootless docker ([#779](https://github.com/testcontainers/testcontainers-python/issues/779)) ([6817582](https://github.com/testcontainers/testcontainers-python/commit/6817582bf67ed36448b69019ab897c50ae80e7e1))
* **core:** Typing in docker_client ([#702](https://github.com/testcontainers/testcontainers-python/issues/702)) ([e8bf224](https://github.com/testcontainers/testcontainers-python/commit/e8bf2244c7210e31b34e5fecf2602fdd1b8c0834))
* **core:** Typing in generic + network ([#700](https://github.com/testcontainers/testcontainers-python/issues/700)) ([2061912](https://github.com/testcontainers/testcontainers-python/commit/2061912e67705be801136f349f372f542a1f262f))
* **core:** Typing in version ([#701](https://github.com/testcontainers/testcontainers-python/issues/701)) ([9dc2a02](https://github.com/testcontainers/testcontainers-python/commit/9dc2a02ca9b9ffbaacfd7de79ec9f78175758ec0))
* **core:** wait in test core registry ([#812](https://github.com/testcontainers/testcontainers-python/issues/812)) ([b574c0e](https://github.com/testcontainers/testcontainers-python/commit/b574c0e0a11d57c8c56aef448292f8c2fc233078))
* **modules:** fix cosmosdb failure ([#827](https://github.com/testcontainers/testcontainers-python/issues/827)) ([dafcbed](https://github.com/testcontainers/testcontainers-python/commit/dafcbed7608e857bebcdd0b4638bec27abadc693))
* **modules:** update chroma version ([#826](https://github.com/testcontainers/testcontainers-python/issues/826)) ([b7d41dd](https://github.com/testcontainers/testcontainers-python/commit/b7d41ddc5742dd380b6e01c712a02b044a64cbb3))
* **rabbitmq:** correct pika pypi reference ([#817](https://github.com/testcontainers/testcontainers-python/issues/817)) ([e90d308](https://github.com/testcontainers/testcontainers-python/commit/e90d30826fb7d7cf3cc7db39a86465d448aaa6e0))
* **registry:** module typed ([#811](https://github.com/testcontainers/testcontainers-python/issues/811)) ([6b11268](https://github.com/testcontainers/testcontainers-python/commit/6b1126884c82529a93bd55030374d322dd0870bc))
* use connection mode override function in config ([#775](https://github.com/testcontainers/testcontainers-python/issues/775)) ([ab2a1ab](https://github.com/testcontainers/testcontainers-python/commit/ab2a1abd957ffb35719f673a7674df83287f1545)), closes [#774](https://github.com/testcontainers/testcontainers-python/issues/774)

## [4.10.0](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.9.2...testcontainers-v4.10.0) (2025-04-02)


### Features

* Add SocatContainer ([#795](https://github.com/testcontainers/testcontainers-python/issues/795)) ([2f9139c](https://github.com/testcontainers/testcontainers-python/commit/2f9139ca3ea9fba36325373b63635a5f539a3003))


### Bug Fixes

* **ollama:** make device request a list ([#799](https://github.com/testcontainers/testcontainers-python/issues/799)) ([9497a45](https://github.com/testcontainers/testcontainers-python/commit/9497a45c39d13761aa3dd30dd5605676cbbe4b46))
* **security:** Update track-modules job ([#787](https://github.com/testcontainers/testcontainers-python/issues/787)) ([f979525](https://github.com/testcontainers/testcontainers-python/commit/f97952505eba089f9cbbc979f8091dafbf520669))

## [4.9.2](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.9.1...testcontainers-v4.9.2) (2025-02-26)


### Bug Fixes

* Change env var disabling OpenSearch security plugin ([#773](https://github.com/testcontainers/testcontainers-python/issues/773)) ([2620d7f](https://github.com/testcontainers/testcontainers-python/commit/2620d7fb1157caa18c3bef4bf2f9b3b79cd2f075))
* **core:** create_label test ([#771](https://github.com/testcontainers/testcontainers-python/issues/771)) ([7517297](https://github.com/testcontainers/testcontainers-python/commit/751729722a013b46f67c09b4318b1b3d92b98008))
* **core:** multiple container start invocations with custom labels ([#769](https://github.com/testcontainers/testcontainers-python/issues/769)) ([3e783a8](https://github.com/testcontainers/testcontainers-python/commit/3e783a80aa11b9c87201404a895d922624f0d451))
* **keycloak:** Fixed Keycloak testcontainer for latest version v26.1.0 ([#766](https://github.com/testcontainers/testcontainers-python/issues/766)) ([b1642e9](https://github.com/testcontainers/testcontainers-python/commit/b1642e98c4d349564c4365782d1b58c9810b719a))
* **scylla:** scylla get cluster method ([#778](https://github.com/testcontainers/testcontainers-python/issues/778)) ([46913c1](https://github.com/testcontainers/testcontainers-python/commit/46913c18a8b6f37bf8dc193828148926b6fc56a8))


### Documentation

* Fixed typo in CONTRIBUTING.md ([#767](https://github.com/testcontainers/testcontainers-python/issues/767)) ([f0bb0f5](https://github.com/testcontainers/testcontainers-python/commit/f0bb0f54bea83885698bd137e24c397498709362))

## [4.9.1](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.9.0...testcontainers-v4.9.1) (2025-01-21)


### Bug Fixes

* milvus healthcheck: use correct requests errors ([#759](https://github.com/testcontainers/testcontainers-python/issues/759)) ([78b137c](https://github.com/testcontainers/testcontainers-python/commit/78b137cfe53fc81eb8d5d858e98610fb6a8792ad))
* **mysql:** add dialect parameter instead of hardcoded mysql dialect ([#739](https://github.com/testcontainers/testcontainers-python/issues/739)) ([8d77bd3](https://github.com/testcontainers/testcontainers-python/commit/8d77bd3541e1c5e73c7ed5d5bd3c0d7bb617f5c0))
* **tests:** replace dind-test direct docker usage with sdk ([#750](https://github.com/testcontainers/testcontainers-python/issues/750)) ([ace2a7d](https://github.com/testcontainers/testcontainers-python/commit/ace2a7d143fb80576ddc0859a9106aa8652f2356))

## [4.9.0](https://github.com/testcontainers/testcontainers-python/compare/testcontainers-v4.8.2...testcontainers-v4.9.0) (2024-11-26)


Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM python:3.11-slim

RUN pip install poetry

WORKDIR /docs
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ coverage: ## Target to combine and report coverage.
lint: ## Lint all files in the project, which we also run in pre-commit
poetry run pre-commit run -a

mypy-core: ## Run mypy on the core package
poetry run mypy --config-file pyproject.toml core

mypy-core-report: ## Generate a report for mypy on the core package
poetry run mypy --config-file pyproject.toml core | poetry run python scripts/mypy_report.py

docs: ## Build the docs for the project
poetry run sphinx-build -nW . docs/_build

Expand Down Expand Up @@ -65,3 +71,39 @@ clean-all: clean ## Remove all generated files and reset the local virtual envir
.PHONY: help
help: ## Display command usage
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

## --------------------------------------

DOCS_CONTAINER=mkdocs-container
DOCS_IMAGE=mkdocs-poetry
DOCS_DOCKERFILE := Dockerfile.docs

.PHONY: clean-docs
clean-docs:
@echo "Destroying docs"
@if docker ps -a --format '{{.Names}}' | grep -q '^$(DOCS_CONTAINER)$$'; then \
docker rm -f $(DOCS_CONTAINER); \
fi
@if docker images -q $(DOCS_IMAGE) | grep -q .; then \
docker rmi $(DOCS_IMAGE); \
fi

.PHONY: docs-ensure-image
docs-ensure-image:
@if [ -z "$$(docker images -q $(DOCS_IMAGE))" ]; then \
docker build -f $(DOCS_DOCKERFILE) -t $(DOCS_IMAGE) . ; \
fi

.PHONY: serve-docs
serve-docs: docs-ensure-image
docker run --rm --name $(DOCS_CONTAINER) -it -p 8000:8000 \
-v $(PWD):/testcontainers-go \
-w /testcontainers-go \
$(DOCS_IMAGE) bash -c "\
cd docs && poetry install --no-root && \
poetry run mkdocs serve -f ../mkdocs.yml -a 0.0.0.0:8000"

# Needed if dependencies are added to the docs site
.PHONY: export-docs-deps
export-docs-deps:
cd docs && poetry export --without-hashes --output requirements.txt
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for more details.

## Configuration

You can set environment variables to configure the library behaviour:

| Env Variable | Example | Description |
| --------------------------------------- | --------------------------- | ---------------------------------------------------------------------------------- |
| `TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE` | `/var/run/docker.sock` | Path to Docker's socket used by ryuk |
| `TESTCONTAINERS_RYUK_PRIVILEGED` | `false` | Run ryuk as a privileged container |
| `TESTCONTAINERS_RYUK_DISABLED` | `false` | Disable ryuk |
| `RYUK_CONTAINER_IMAGE` | `testcontainers/ryuk:0.8.1` | Custom image for ryuk |
| `RYUK_RECONNECTION_TIMEOUT` | `10s` | Reconnection timeout for Ryuk TCP socket before Ryuk reaps all dangling containers |

Alternatively you can set the configuration during runtime:

```python
from testcontainers.core import testcontainers_config

testcontainers_config.ryuk_docker_socket = "/home/user/docker.sock"
```
4 changes: 4 additions & 0 deletions compose.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Docker Compose
==============

Docker compose is described in :ref:`Testcontainers Core`.
9 changes: 8 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
]

# Configure autodoc to avoid excessively long fully-qualified names.
Expand Down Expand Up @@ -160,5 +161,11 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"selenium": ("https://seleniumhq.github.io/selenium/docs/api/py/", None),
"selenium": ("https://www.selenium.dev/selenium/docs/api/py/", None),
"typing_extensions": ("https://typing-extensions.readthedocs.io/en/latest/", None),
}

nitpick_ignore = [
("py:class", "typing_extensions.Self"),
("py:class", "docker.models.containers.ExecResult"),
]
Loading