From 972cc306253c452c06a33e8c59507f58c9a26c6d Mon Sep 17 00:00:00 2001 From: Terry Smith Date: Tue, 6 May 2025 16:02:07 -0300 Subject: [PATCH 1/7] chore: update poetry and tests to support arm machines --- Makefile | 16 +++++++++-- core/tests/test_utils.py | 1 - .../cosmosdb/tests/test_cosmosdb_emulator.py | 3 ++ .../cosmosdb/tests/test_cosmosdb_mongodb.py | 4 +++ modules/cosmosdb/tests/test_cosmosdb_nosql.py | 3 ++ modules/db2/tests/test_db2.py | 1 + .../elasticsearch/tests/test_elasticsearch.py | 2 ++ modules/google/tests/test_google.py | 4 ++- scripts/list_arm_extras.py | 28 +++++++++++++++++++ 9 files changed, 58 insertions(+), 4 deletions(-) create mode 100755 scripts/list_arm_extras.py diff --git a/Makefile b/Makefile index b5dbe88ea..5d687abac 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,28 @@ PYTHON_VERSION ?= 3.10 IMAGE = testcontainers-python:${PYTHON_VERSION} -PACKAGES = core $(addprefix modules/,$(notdir $(wildcard modules/*))) +PACKAGES = core $(addprefix modules/,$(notdir $(filter %/, $(wildcard modules/*/)))) UPLOAD = $(addsuffix /upload,${PACKAGES}) -TESTS = $(addsuffix /tests,$(filter-out meta,${PACKAGES})) +TESTS = $(addsuffix /tests,$(filter-out meta,$(filter-out %.md %.txt,${PACKAGES}))) TESTS_DIND = $(addsuffix -dind,${TESTS}) DOCTESTS = $(addsuffix /doctests,$(filter-out modules/README.md,${PACKAGES})) +ARCH := $(shell uname -m) +ARM_ARCHS := arm64 aarch64 +IS_ARM := $(filter $(ARCH),$(ARM_ARCHS)) + +# List of safe extras (excluding 'db2') with original TOML keys +EXTRAS_LIST := $(shell $(PYTHON) scripts/list_arm_extras.py) install: ## Set up the project for development +ifeq ($(IS_ARM),$(ARCH)) + @echo "Detected ARM architecture, skipping 'db2' extra (ibm-db is incompatible)" + poetry install $(foreach extra,$(EXTRAS_LIST),--extras $(extra)) +else + @echo "Detected non-ARM architecture, installing all extras" poetry install --all-extras +endif poetry run pre-commit install build: ## Build the python package diff --git a/core/tests/test_utils.py b/core/tests/test_utils.py index 1923483ea..182b18eba 100644 --- a/core/tests/test_utils.py +++ b/core/tests/test_utils.py @@ -33,7 +33,6 @@ def test_is_windows(monkeypatch: MonkeyPatch) -> None: def test_is_arm(monkeypatch: MonkeyPatch) -> None: - assert not utils.is_arm() monkeypatch.setattr("platform.machine", lambda: "arm64") assert utils.is_arm() monkeypatch.setattr("platform.machine", lambda: "aarch64") diff --git a/modules/cosmosdb/tests/test_cosmosdb_emulator.py b/modules/cosmosdb/tests/test_cosmosdb_emulator.py index 542ddd11c..41653cd4a 100644 --- a/modules/cosmosdb/tests/test_cosmosdb_emulator.py +++ b/modules/cosmosdb/tests/test_cosmosdb_emulator.py @@ -1,7 +1,10 @@ import pytest from testcontainers.cosmosdb._emulator import CosmosDBEmulatorContainer +from testcontainers.core.utils import is_arm + +@pytest.mark.skipif(is_arm(), reason="db2 container not available for ARM") def test_runs(): with CosmosDBEmulatorContainer(partition_count=1, bind_ports=False) as emulator: assert emulator.server_certificate_pem is not None diff --git a/modules/cosmosdb/tests/test_cosmosdb_mongodb.py b/modules/cosmosdb/tests/test_cosmosdb_mongodb.py index a50ee82ea..3c10ee19f 100644 --- a/modules/cosmosdb/tests/test_cosmosdb_mongodb.py +++ b/modules/cosmosdb/tests/test_cosmosdb_mongodb.py @@ -1,7 +1,10 @@ import pytest from testcontainers.cosmosdb import CosmosDBMongoEndpointContainer +from testcontainers.core.utils import is_arm + +@pytest.mark.skipif(is_arm(), reason="db2 container not available for ARM") def test_requires_a_version(): with pytest.raises(AssertionError, match="A MongoDB version is required"): CosmosDBMongoEndpointContainer(mongodb_version=None) @@ -10,6 +13,7 @@ def test_requires_a_version(): CosmosDBMongoEndpointContainer(mongodb_version="4.0") +@pytest.mark.skipif(is_arm(), reason="db2 container not available for ARM") def test_runs(): with CosmosDBMongoEndpointContainer(mongodb_version="4.0", partition_count=1, bind_ports=False) as emulator: assert emulator.env["AZURE_COSMOS_EMULATOR_ENABLE_MONGODB_ENDPOINT"] == "4.0" diff --git a/modules/cosmosdb/tests/test_cosmosdb_nosql.py b/modules/cosmosdb/tests/test_cosmosdb_nosql.py index a9460a1b0..a48a52ac8 100644 --- a/modules/cosmosdb/tests/test_cosmosdb_nosql.py +++ b/modules/cosmosdb/tests/test_cosmosdb_nosql.py @@ -1,7 +1,10 @@ import pytest from testcontainers.cosmosdb import CosmosDBNoSQLEndpointContainer +from testcontainers.core.utils import is_arm + +@pytest.mark.skipif(is_arm(), reason="db2 container not available for ARM") def test_runs(): with CosmosDBNoSQLEndpointContainer(partition_count=1, bind_ports=False) as emulator: assert emulator.get_exposed_port(8081) is not None, "The NoSQL endpoint's port should be exposed" diff --git a/modules/db2/tests/test_db2.py b/modules/db2/tests/test_db2.py index 7b6ea844a..c354832ff 100644 --- a/modules/db2/tests/test_db2.py +++ b/modules/db2/tests/test_db2.py @@ -26,6 +26,7 @@ def test_docker_run_db2(version: str): # - sqlserver # - mongodb # - db2 +@pytest.mark.skipif(is_arm(), reason="db2 container not available for ARM") def test_quoted_password(): user = "db2inst1" dbname = "testdb" diff --git a/modules/elasticsearch/tests/test_elasticsearch.py b/modules/elasticsearch/tests/test_elasticsearch.py index 661a550c6..5108bb40f 100644 --- a/modules/elasticsearch/tests/test_elasticsearch.py +++ b/modules/elasticsearch/tests/test_elasticsearch.py @@ -3,11 +3,13 @@ import pytest +from testcontainers.core.utils import is_arm from testcontainers.elasticsearch import ElasticSearchContainer # The versions below should reflect the latest stable releases @pytest.mark.parametrize("version", ["7.17.18", "8.12.2"]) +@pytest.mark.skipif(is_arm(), reason="db2 container not available for ARM") def test_docker_run_elasticsearch(version): with ElasticSearchContainer(f"elasticsearch:{version}", mem_limit="3G") as es: resp = urllib.request.urlopen(es.get_url()) diff --git a/modules/google/tests/test_google.py b/modules/google/tests/test_google.py index 0c412d706..9b2229ac8 100644 --- a/modules/google/tests/test_google.py +++ b/modules/google/tests/test_google.py @@ -1,6 +1,7 @@ from queue import Queue from google.cloud.datastore import Entity +import time from testcontainers.core.waiting_utils import wait_for_logs from testcontainers.google import PubSubContainer, DatastoreContainer @@ -25,7 +26,8 @@ def test_pubsub_container(): # Receive the message queue = Queue() subscriber.subscribe(subscription_path, queue.put) - message = queue.get(timeout=1) + # timeout 10 is needed to account for slower arm machines + message = queue.get(timeout=10) assert message.data == b"Hello world!" message.ack() diff --git a/scripts/list_arm_extras.py b/scripts/list_arm_extras.py new file mode 100755 index 000000000..aebe3ff66 --- /dev/null +++ b/scripts/list_arm_extras.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# used to generate the list of extras in the Makefile +import sys +from pathlib import Path + +# Support both Python 3.10 (needs tomli) and 3.11+ (has tomllib) +if sys.version_info >= (3, 11): + import tomllib +else: + try: + import tomli as tomllib + except ImportError: + ## Python <3.11 detected but 'tomli' is not installed, poetry add --group dev tomli + sys.exit(1) + +SKIPPED_EXTRAS = {"db2"} # skip incompatible extras + + +def get_filtered_extras() -> list[str]: + with Path("pyproject.toml").open("rb") as f: + data = tomllib.load(f) + extras = data["tool"]["poetry"]["extras"] + return [key for key in extras if key not in SKIPPED_EXTRAS] + + +if __name__ == "__main__": + sys.stdout.write(" ".join(get_filtered_extras()) + "\n") From 776c60210ad0fbd445832d8f10907c923d55fdd6 Mon Sep 17 00:00:00 2001 From: Terry Smith Date: Tue, 6 May 2025 17:38:43 -0300 Subject: [PATCH 2/7] chore: enable docker in docker tests to pass on arm machines --- Dockerfile | 15 +++++++++++++-- core/__init__.py | 0 core/tests/__init__.py | 0 core/tests/conftest.py | 10 +++++++++- core/tests/list_arm_extras.py | 18 ++++++++++++++++++ 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 core/__init__.py create mode 100644 core/tests/__init__.py create mode 100644 core/tests/list_arm_extras.py diff --git a/Dockerfile b/Dockerfile index 865771fa1..001dbefc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ ARG PYTHON_VERSION=3.10 FROM python:${PYTHON_VERSION}-slim-bookworm +ARG POETRY_EXTRAS + +ENV PYTHONPATH=/workspace ENV POETRY_NO_INTERACTION=1 \ POETRY_VIRTUALENVS_IN_PROJECT=1 \ @@ -20,10 +23,18 @@ RUN bash -c 'python -m venv /opt/poetry-venv && source $_/bin/activate && pip in # install dependencies with poetry COPY pyproject.toml . COPY poetry.lock . -RUN poetry install --all-extras --with dev --no-root +RUN if [ "$POETRY_EXTRAS" = "" ]; then \ + poetry install --all-extras --with dev --no-root; \ + else \ + poetry install --extras "$POETRY_EXTRAS" --with dev --no-root; \ + fi # copy project source COPY . . # install project with poetry -RUN poetry install --all-extras --with dev +RUN if [ "$POETRY_EXTRAS" = "" ]; then \ + poetry install --all-extras --with dev; \ + else \ + poetry install --extras "$POETRY_EXTRAS" --with dev; \ + fi diff --git a/core/__init__.py b/core/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/core/tests/__init__.py b/core/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/core/tests/conftest.py b/core/tests/conftest.py index a86faa109..902899e69 100644 --- a/core/tests/conftest.py +++ b/core/tests/conftest.py @@ -3,8 +3,11 @@ import pytest from typing import Callable from testcontainers.core.container import DockerClient +from testcontainers.core.utils import is_arm import sys +from .list_arm_extras import get_arm_extras + PROJECT_DIR = Path(__file__).parent.parent.parent.resolve() @@ -24,11 +27,16 @@ def python_testcontainer_image() -> str: py_version = ".".join(map(str, sys.version_info[:2])) image_name = f"testcontainers-python:{py_version}" client = DockerClient() + build_args = {"PYTHON_VERSION": py_version} + + if is_arm(): + build_args["POETRY_EXTRAS"] = get_arm_extras() + client.build( path=str(PROJECT_DIR), tag=image_name, rm=False, - buildargs={"PYTHON_VERSION": py_version}, + buildargs=build_args, ) return image_name diff --git a/core/tests/list_arm_extras.py b/core/tests/list_arm_extras.py new file mode 100644 index 000000000..573505d5f --- /dev/null +++ b/core/tests/list_arm_extras.py @@ -0,0 +1,18 @@ +from pathlib import Path +from testcontainers.core.utils import is_arm + +try: + import tomllib # Python 3.11+ +except ImportError: + import tomli as tomllib + +SKIPPED_EXTRAS = {"db2"} # skip incompatible extras + + +def get_arm_extras(): + with Path("pyproject.toml").open("rb") as f: + data = tomllib.load(f) + + extras = data["tool"]["poetry"]["extras"] + skip = SKIPPED_EXTRAS + return " ".join(k for k in extras if k not in skip) From 59d19689ae629731cc5a7c2381cb01723244f2f4 Mon Sep 17 00:00:00 2001 From: Terry Smith Date: Tue, 6 May 2025 18:13:25 -0300 Subject: [PATCH 3/7] chore: add mac integration skips --- Makefile | 2 -- core/tests/test_core_registry.py | 9 +++++++++ core/tests/test_docker_in_docker.py | 8 ++++++++ core/tests/test_ryuk.py | 8 ++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5d687abac..bf7287e53 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,8 @@ EXTRAS_LIST := $(shell $(PYTHON) scripts/list_arm_extras.py) install: ## Set up the project for development ifeq ($(IS_ARM),$(ARCH)) - @echo "Detected ARM architecture, skipping 'db2' extra (ibm-db is incompatible)" poetry install $(foreach extra,$(EXTRAS_LIST),--extras $(extra)) else - @echo "Detected non-ARM architecture, installing all extras" poetry install --all-extras endif poetry run pre-commit install diff --git a/core/tests/test_core_registry.py b/core/tests/test_core_registry.py index 384b06693..36e4730f9 100644 --- a/core/tests/test_core_registry.py +++ b/core/tests/test_core_registry.py @@ -18,8 +18,13 @@ from testcontainers.core.waiting_utils import wait_container_is_ready from testcontainers.registry import DockerRegistryContainer +from testcontainers.core.utils import is_mac +@pytest.mark.skipif( + is_mac(), + reason="Docker Desktop on macOS does not support insecure private registries without daemon reconfiguration", +) def test_missing_on_private_registry(monkeypatch): username = "user" password = "pass" @@ -41,6 +46,10 @@ def test_missing_on_private_registry(monkeypatch): wait_container_is_ready(test_container) +@pytest.mark.skipif( + is_mac(), + reason="Docker Desktop on macOS does not support local insecure registries over HTTP without modifying daemon settings", +) @pytest.mark.parametrize( "image,tag,username,password", [ diff --git a/core/tests/test_docker_in_docker.py b/core/tests/test_docker_in_docker.py index b07f80e9a..02b8e1fc4 100644 --- a/core/tests/test_docker_in_docker.py +++ b/core/tests/test_docker_in_docker.py @@ -15,6 +15,7 @@ from testcontainers.core.container import DockerContainer from testcontainers.core.docker_client import DockerClient, LOGGER from testcontainers.core.utils import inside_container +from testcontainers.core.utils import is_mac from testcontainers.core.waiting_utils import wait_for_logs @@ -36,6 +37,7 @@ def _wait_for_dind_return_ip(client, dind): return docker_host_ip +@pytest.mark.skipif(is_mac(), reason="Docker socket forwarding (socat) is unsupported on Docker Desktop for macOS") def test_wait_for_logs_docker_in_docker(): # real dind isn't possible (AFAIK) in CI # forwarding the socket to a container port is at least somewhat the same @@ -64,6 +66,9 @@ def test_wait_for_logs_docker_in_docker(): not_really_dind.remove() +@pytest.mark.skipif( + is_mac(), reason="Bridge networking and Docker socket forwarding are not supported on Docker Desktop for macOS" +) def test_dind_inherits_network(): client = DockerClient() try: @@ -158,6 +163,9 @@ def test_find_host_network_in_dood() -> None: assert DockerClient().find_host_network() == os.environ[EXPECTED_NETWORK_VAR] +@pytest.mark.skipif( + is_mac(), reason="Docker socket mounting and container networking do not work reliably on Docker Desktop for macOS" +) @pytest.mark.skipif(not Path(tcc.ryuk_docker_socket).exists(), reason="No docker socket available") def test_dood(python_testcontainer_image: str) -> None: """ diff --git a/core/tests/test_ryuk.py b/core/tests/test_ryuk.py index 5d6b208af..76556d4f4 100644 --- a/core/tests/test_ryuk.py +++ b/core/tests/test_ryuk.py @@ -8,9 +8,14 @@ from testcontainers.core.config import testcontainers_config from testcontainers.core.container import Reaper from testcontainers.core.container import DockerContainer +from testcontainers.core.utils import is_mac from testcontainers.core.waiting_utils import wait_for_logs +@pytest.mark.skipif( + is_mac(), + reason="Ryuk container reaping is unreliable on Docker Desktop for macOS due to VM-based container lifecycle handling", +) @pytest.mark.inside_docker_check def test_wait_for_reaper(monkeypatch: MonkeyPatch): Reaper.delete_instance() @@ -41,6 +46,9 @@ def test_wait_for_reaper(monkeypatch: MonkeyPatch): Reaper.delete_instance() +@pytest.mark.skipif( + is_mac(), reason="Ryuk disabling behavior is unreliable on Docker Desktop for macOS due to Docker socket emulation" +) @pytest.mark.inside_docker_check def test_container_without_ryuk(monkeypatch: MonkeyPatch): Reaper.delete_instance() From c0653d0d72e0f5ae17ffe97a2d8abcf1f5f2d18f Mon Sep 17 00:00:00 2001 From: Terry Smith Date: Wed, 7 May 2025 14:05:15 -0300 Subject: [PATCH 4/7] refactor: experiment with simplifying build using unreliable markers which seems to work with ibm specifically --- Dockerfile | 15 ++------------- Makefile | 13 +------------ core/__init__.py | 0 core/tests/__init__.py | 0 core/tests/conftest.py | 10 +--------- core/tests/list_arm_extras.py | 18 ------------------ poetry.lock | 8 ++++---- pyproject.toml | 2 +- scripts/list_arm_extras.py | 28 ---------------------------- 9 files changed, 9 insertions(+), 85 deletions(-) delete mode 100644 core/__init__.py delete mode 100644 core/tests/__init__.py delete mode 100644 core/tests/list_arm_extras.py delete mode 100755 scripts/list_arm_extras.py diff --git a/Dockerfile b/Dockerfile index 001dbefc6..865771fa1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ ARG PYTHON_VERSION=3.10 FROM python:${PYTHON_VERSION}-slim-bookworm -ARG POETRY_EXTRAS - -ENV PYTHONPATH=/workspace ENV POETRY_NO_INTERACTION=1 \ POETRY_VIRTUALENVS_IN_PROJECT=1 \ @@ -23,18 +20,10 @@ RUN bash -c 'python -m venv /opt/poetry-venv && source $_/bin/activate && pip in # install dependencies with poetry COPY pyproject.toml . COPY poetry.lock . -RUN if [ "$POETRY_EXTRAS" = "" ]; then \ - poetry install --all-extras --with dev --no-root; \ - else \ - poetry install --extras "$POETRY_EXTRAS" --with dev --no-root; \ - fi +RUN poetry install --all-extras --with dev --no-root # copy project source COPY . . # install project with poetry -RUN if [ "$POETRY_EXTRAS" = "" ]; then \ - poetry install --all-extras --with dev; \ - else \ - poetry install --extras "$POETRY_EXTRAS" --with dev; \ - fi +RUN poetry install --all-extras --with dev diff --git a/Makefile b/Makefile index bf7287e53..ebcd08625 100644 --- a/Makefile +++ b/Makefile @@ -3,26 +3,15 @@ PYTHON_VERSION ?= 3.10 IMAGE = testcontainers-python:${PYTHON_VERSION} -PACKAGES = core $(addprefix modules/,$(notdir $(filter %/, $(wildcard modules/*/)))) +PACKAGES = core $(addprefix modules/,$(notdir $(wildcard modules/*))) UPLOAD = $(addsuffix /upload,${PACKAGES}) TESTS = $(addsuffix /tests,$(filter-out meta,$(filter-out %.md %.txt,${PACKAGES}))) TESTS_DIND = $(addsuffix -dind,${TESTS}) DOCTESTS = $(addsuffix /doctests,$(filter-out modules/README.md,${PACKAGES})) -ARCH := $(shell uname -m) -ARM_ARCHS := arm64 aarch64 -IS_ARM := $(filter $(ARCH),$(ARM_ARCHS)) - -# List of safe extras (excluding 'db2') with original TOML keys -EXTRAS_LIST := $(shell $(PYTHON) scripts/list_arm_extras.py) - install: ## Set up the project for development -ifeq ($(IS_ARM),$(ARCH)) - poetry install $(foreach extra,$(EXTRAS_LIST),--extras $(extra)) -else poetry install --all-extras -endif poetry run pre-commit install build: ## Build the python package diff --git a/core/__init__.py b/core/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/tests/__init__.py b/core/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/tests/conftest.py b/core/tests/conftest.py index 902899e69..a86faa109 100644 --- a/core/tests/conftest.py +++ b/core/tests/conftest.py @@ -3,11 +3,8 @@ import pytest from typing import Callable from testcontainers.core.container import DockerClient -from testcontainers.core.utils import is_arm import sys -from .list_arm_extras import get_arm_extras - PROJECT_DIR = Path(__file__).parent.parent.parent.resolve() @@ -27,16 +24,11 @@ def python_testcontainer_image() -> str: py_version = ".".join(map(str, sys.version_info[:2])) image_name = f"testcontainers-python:{py_version}" client = DockerClient() - build_args = {"PYTHON_VERSION": py_version} - - if is_arm(): - build_args["POETRY_EXTRAS"] = get_arm_extras() - client.build( path=str(PROJECT_DIR), tag=image_name, rm=False, - buildargs=build_args, + buildargs={"PYTHON_VERSION": py_version}, ) return image_name diff --git a/core/tests/list_arm_extras.py b/core/tests/list_arm_extras.py deleted file mode 100644 index 573505d5f..000000000 --- a/core/tests/list_arm_extras.py +++ /dev/null @@ -1,18 +0,0 @@ -from pathlib import Path -from testcontainers.core.utils import is_arm - -try: - import tomllib # Python 3.11+ -except ImportError: - import tomli as tomllib - -SKIPPED_EXTRAS = {"db2"} # skip incompatible extras - - -def get_arm_extras(): - with Path("pyproject.toml").open("rb") as f: - data = tomllib.load(f) - - extras = data["tool"]["poetry"]["extras"] - skip = SKIPPED_EXTRAS - return " ".join(k for k in extras if k not in skip) diff --git a/poetry.lock b/poetry.lock index 89b14b07f..e0b52f8c8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -1617,7 +1617,7 @@ description = "Python DBI driver for DB2 (LUW, zOS, i5) and IDS" optional = true python-versions = "*" groups = ["main"] -markers = "extra == \"db2\"" +markers = "platform_machine != \"aarch64\" and platform_machine != \"arm64\" and extra == \"db2\"" files = [ {file = "ibm_db-3.2.3-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:3399466141c29704f4e8ba709a67ba27ab413239c0244c3c4510126e946ff603"}, {file = "ibm_db-3.2.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e12ff6426d4f718e1ff6615e64a2880bd570826f19a031c82dbf296714cafd7d"}, @@ -1659,7 +1659,7 @@ description = "SQLAlchemy support for IBM Data Servers" optional = true python-versions = "*" groups = ["main"] -markers = "extra == \"db2\"" +markers = "platform_machine != \"aarch64\" and platform_machine != \"arm64\" and extra == \"db2\"" files = [ {file = "ibm_db_sa-0.4.1-py3-none-any.whl", hash = "sha256:49926ba9799e6ebd9ddd847141537c83d179ecf32fe24b7e997ac4614d3f616a"}, {file = "ibm_db_sa-0.4.1.tar.gz", hash = "sha256:a46df130a3681646490925cf4e1bca12b46283f71eea39b70b4f9a56e95341ac"}, @@ -4986,4 +4986,4 @@ weaviate = ["weaviate-client"] [metadata] lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "5c400cc87dc9708588ee8d7d50646de789235732d868b74ebc43f1cf2a403c88" +content-hash = "91d17ef0905329e552e8181a3b12f03e4c5244a7f23b9278168588e76c2a5802" diff --git a/pyproject.toml b/pyproject.toml index 51a93a340..90689fbc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,7 +118,7 @@ httpx = { version = "*", optional = true } azure-cosmos = { version = "*", optional = true } cryptography = { version = "*", optional = true } trino = { version = "*", optional = true } -ibm_db_sa = { version = "*", optional = true } +ibm_db_sa = { version = "*", optional = true, markers = "platform_machine != 'aarch64' and platform_machine != 'arm64'" } [tool.poetry.extras] arangodb = ["python-arango"] diff --git a/scripts/list_arm_extras.py b/scripts/list_arm_extras.py deleted file mode 100755 index aebe3ff66..000000000 --- a/scripts/list_arm_extras.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 - -# used to generate the list of extras in the Makefile -import sys -from pathlib import Path - -# Support both Python 3.10 (needs tomli) and 3.11+ (has tomllib) -if sys.version_info >= (3, 11): - import tomllib -else: - try: - import tomli as tomllib - except ImportError: - ## Python <3.11 detected but 'tomli' is not installed, poetry add --group dev tomli - sys.exit(1) - -SKIPPED_EXTRAS = {"db2"} # skip incompatible extras - - -def get_filtered_extras() -> list[str]: - with Path("pyproject.toml").open("rb") as f: - data = tomllib.load(f) - extras = data["tool"]["poetry"]["extras"] - return [key for key in extras if key not in SKIPPED_EXTRAS] - - -if __name__ == "__main__": - sys.stdout.write(" ".join(get_filtered_extras()) + "\n") From 28d702476e79ca637c5919b94070eb143cf0da21 Mon Sep 17 00:00:00 2001 From: Terry Smith Date: Thu, 8 May 2025 12:55:09 -0300 Subject: [PATCH 5/7] fix: resolve failed checks --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2500175a8..9c820ffa5 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,11 @@ IMAGE = testcontainers-python:${PYTHON_VERSION} PACKAGES = core $(addprefix modules/,$(notdir $(wildcard modules/*))) UPLOAD = $(addsuffix /upload,${PACKAGES}) -TESTS = $(addsuffix /tests,$(filter-out meta,$(filter-out %.md %.txt,${PACKAGES}))) +TESTS = $(addsuffix /tests,$(filter-out meta,${PACKAGES})) TESTS_DIND = $(addsuffix -dind,${TESTS}) DOCTESTS = $(addsuffix /doctests,$(filter-out modules/README.md,${PACKAGES})) + install: ## Set up the project for development poetry install --all-extras poetry run pre-commit install From 8cdd6c8a314a9a28db28d2b23a698751c9861400 Mon Sep 17 00:00:00 2001 From: Terry Date: Mon, 12 May 2025 15:51:05 -0300 Subject: [PATCH 6/7] ci: adds docker version and docker compose version to help with debugging failures --- .github/workflows/ci-core.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 4ee4f4a59..68c418597 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -25,6 +25,14 @@ jobs: run: poetry install --all-extras - name: Run twine check run: poetry build && poetry run twine check dist/*.tar.gz + - name: Display Docker and Compose Versions + run: | + @echo "##[group]Docker Version" + @docker --version || echo "Docker is not installed or misconfigured" + @echo "##[endgroup]" + @echo "##[group]Docker Compose Version" + @docker compose version || docker-compose --version || echo "Docker Compose is not installed or misconfigured" + @echo "##[endgroup]" - name: Run tests run: make core/tests - name: Rename coverage file From 15d7424276ffd9221a848aa6d4e83c837ad08943 Mon Sep 17 00:00:00 2001 From: David Ankin Date: Sun, 18 May 2025 00:07:42 -0400 Subject: [PATCH 7/7] github actions run is a bash script not a makefile target recipe --- .github/workflows/ci-core.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 68c418597..3c4d4e797 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -27,12 +27,12 @@ jobs: run: poetry build && poetry run twine check dist/*.tar.gz - name: Display Docker and Compose Versions run: | - @echo "##[group]Docker Version" - @docker --version || echo "Docker is not installed or misconfigured" - @echo "##[endgroup]" - @echo "##[group]Docker Compose Version" - @docker compose version || docker-compose --version || echo "Docker Compose is not installed or misconfigured" - @echo "##[endgroup]" + echo "##[group]Docker Version" + docker --version || echo "Docker is not installed or misconfigured" + echo "##[endgroup]" + echo "##[group]Docker Compose Version" + docker compose version || docker-compose --version || echo "Docker Compose is not installed or misconfigured" + echo "##[endgroup]" - name: Run tests run: make core/tests - name: Rename coverage file