Skip to content

Commit

Permalink
Use poetry update instead of removing poetry.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
lampham789 committed Aug 26, 2024
1 parent f2c2b1e commit 505f3eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 . .
Expand Down

0 comments on commit 505f3eb

Please sign in to comment.