From 505f3eb59931deb0ddb63db6bf981930b26e02af Mon Sep 17 00:00:00 2001 From: lampham789 Date: Mon, 26 Aug 2024 13:56:15 -0700 Subject: [PATCH] Use poetry update instead of removing poetry.lock --- .github/workflows/docker-matrix.yml | 2 +- Dockerfile | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-matrix.yml b/.github/workflows/docker-matrix.yml index b2ab06c..652bba9 100644 --- a/.github/workflows/docker-matrix.yml +++ b/.github/workflows/docker-matrix.yml @@ -38,6 +38,6 @@ jobs: elif [[ "${{ matrix.update-strategy }}" == "minor" ]]; then echo "Minor version update" - docker build --build-arg IMAGE_TAG=${{ matrix.image-tag }} --target test-without-lock -t zephir-api2:test . + docker build --build-arg IMAGE_TAG=${{ matrix.image-tag }} --target test-minor-update -t zephir-api2:test . fi \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b9b5535..037a996 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,10 +37,11 @@ FROM poetry AS build COPY pyproject.toml poetry.lock ./ RUN poetry install --no-root --without dev && rm -rf ${POETRY_CACHE_DIR}; -FROM poetry AS build-without-lock +FROM poetry AS build-minor-update # Install minor version updates in the absence of poetry.lock file -COPY pyproject.toml ./ +COPY pyproject.toml poetry.lock ./ RUN poetry install --no-root --without dev && rm -rf ${POETRY_CACHE_DIR}; +RUN poetry update FROM build AS test # Install dev dependencies @@ -50,7 +51,7 @@ COPY . . USER app RUN poetry run pytest tests -FROM build-without-lock AS test-without-lock +FROM build-minor-update AS test-minor-update # Install dev dependencies RUN poetry install --only dev --no-root && rm -rf ${POETRY_CACHE_DIR}; COPY . .