From 1e3e153c986cbea0085bd2d391d079899c59e818 Mon Sep 17 00:00:00 2001 From: Dmitry Meyer Date: Thu, 13 Aug 2026 10:35:11 +0000 Subject: [PATCH] Bump testcontainers>=4.15.0 * Community modules were moved to the `testcontainers.community` subpackage since 4.15.0. Old imports emit warnings: > testcontainers.postgres is deprecated, use > testcontainers.community.postgres instead * Deprecated `wait_container_is_ready` decorator is not used by the postgres module since 4.14.0, making the warning filter redundant --- pyproject.toml | 5 +---- src/dstack/_internal/server/testing/conf.py | 2 +- src/tests/_internal/server/test_migrations.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d52e7db747..99375463e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,9 +146,6 @@ filterwarnings = [ # Fail on any use of a pydantic v1 shim (`.dict()`, `parse_obj_as`, class-based `Config`, ...) # so they cannot creep back after the v2 migration. "error::pydantic.PydanticDeprecatedSince20", - # testcontainers modules use deprecated decorators – nothing we can do: - # https://github.com/testcontainers/testcontainers-python/issues/874 - "ignore:^The @wait_container_is_ready decorator:DeprecationWarning", ] [tool.tox] @@ -195,7 +192,7 @@ test = [ "freezegun>=1.5.1", "httpbin>=0.10.2", # indirect to make compatible with Werkzeug 3 "openai>=1.68.2", - "testcontainers>=4.9.2", + "testcontainers>=4.15.0", ] docs = [ "dstack[server]", diff --git a/src/dstack/_internal/server/testing/conf.py b/src/dstack/_internal/server/testing/conf.py index 054c5c840c..07684bb60f 100644 --- a/src/dstack/_internal/server/testing/conf.py +++ b/src/dstack/_internal/server/testing/conf.py @@ -2,7 +2,7 @@ import pytest_asyncio from sqlalchemy import StaticPool from sqlalchemy.ext.asyncio import create_async_engine -from testcontainers.postgres import PostgresContainer +from testcontainers.community.postgres import PostgresContainer from dstack._internal.server import settings from dstack._internal.server.db import Database, override_db diff --git a/src/tests/_internal/server/test_migrations.py b/src/tests/_internal/server/test_migrations.py index 49022fda61..13fc816b99 100644 --- a/src/tests/_internal/server/test_migrations.py +++ b/src/tests/_internal/server/test_migrations.py @@ -6,7 +6,7 @@ from alembic.util.exc import CommandError from sqlalchemy import create_engine from sqlalchemy.ext.asyncio import create_async_engine -from testcontainers.postgres import PostgresContainer +from testcontainers.community.postgres import PostgresContainer def test_sqlite_migrations(monkeypatch: pytest.MonkeyPatch):