Skip to content

Commit 3db24ac

Browse files
terry-dockeralexanderankin
authored andcommitted
refactor: experiment with simplifying build using unreliable markers which seems to work with ibm specifically
1 parent 2b700a2 commit 3db24ac

File tree

8 files changed

+8
-48
lines changed

8 files changed

+8
-48
lines changed

Dockerfile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
ARG PYTHON_VERSION=3.10
22
FROM python:${PYTHON_VERSION}-slim-bookworm
3-
ARG POETRY_EXTRAS
4-
5-
ENV PYTHONPATH=/workspace
63

74
ENV POETRY_NO_INTERACTION=1 \
85
POETRY_VIRTUALENVS_IN_PROJECT=1 \
@@ -23,18 +20,10 @@ RUN bash -c 'python -m venv /opt/poetry-venv && source $_/bin/activate && pip in
2320
# install dependencies with poetry
2421
COPY pyproject.toml .
2522
COPY poetry.lock .
26-
RUN if [ "$POETRY_EXTRAS" = "" ]; then \
27-
poetry install --all-extras --with dev --no-root; \
28-
else \
29-
poetry install --extras "$POETRY_EXTRAS" --with dev --no-root; \
30-
fi
23+
RUN poetry install --all-extras --with dev --no-root
3124

3225
# copy project source
3326
COPY . .
3427

3528
# install project with poetry
36-
RUN if [ "$POETRY_EXTRAS" = "" ]; then \
37-
poetry install --all-extras --with dev; \
38-
else \
39-
poetry install --extras "$POETRY_EXTRAS" --with dev; \
40-
fi
29+
RUN poetry install --all-extras --with dev

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ DOCTESTS = $(addsuffix /doctests,$(filter-out modules/README.md,${PACKAGES}))
1212

1313

1414
install: ## Set up the project for development
15-
ifeq ($(IS_ARM),$(ARCH))
16-
poetry install $(foreach extra,$(EXTRAS_LIST),--extras $(extra))
17-
else
1815
poetry install --all-extras
1916
poetry run pre-commit install
2017

core/__init__.py

Whitespace-only changes.

core/tests/__init__.py

Whitespace-only changes.

core/tests/conftest.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
from typing import Callable
55
from testcontainers.core.container import DockerClient
66
from pprint import pprint
7-
from testcontainers.core.utils import is_arm
87
import sys
98

10-
from .list_arm_extras import get_arm_extras
11-
129
PROJECT_DIR = Path(__file__).parent.parent.parent.resolve()
1310

1411

@@ -28,16 +25,11 @@ def python_testcontainer_image() -> str:
2825
py_version = ".".join(map(str, sys.version_info[:2]))
2926
image_name = f"testcontainers-python:{py_version}"
3027
client = DockerClient()
31-
build_args = {"PYTHON_VERSION": py_version}
32-
33-
if is_arm():
34-
build_args["POETRY_EXTRAS"] = get_arm_extras()
35-
3628
client.build(
3729
path=str(PROJECT_DIR),
3830
tag=image_name,
3931
rm=False,
40-
buildargs=build_args,
32+
buildargs={"PYTHON_VERSION": py_version},
4133
)
4234
return image_name
4335

core/tests/list_arm_extras.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ httpx = { version = "*", optional = true }
118118
azure-cosmos = { version = "*", optional = true }
119119
cryptography = { version = "*", optional = true }
120120
trino = { version = "*", optional = true }
121-
ibm_db_sa = { version = "*", optional = true }
121+
ibm_db_sa = { version = "*", optional = true, markers = "platform_machine != 'aarch64' and platform_machine != 'arm64'" }
122122

123123
[tool.poetry.extras]
124124
arangodb = ["python-arango"]

0 commit comments

Comments
 (0)