Skip to content

Commit 98ebb01

Browse files
authored
Upgrade Poetry, relock lockfile (#435)
* Updates Poetry to 1.4.0 in the container * Uses "CI method" for downloading and using Poetry * Update `pyproject.toml` to use the new way of managing dependency groups - `tool.poetry.dev-dependencies` is deprecated in favor of using "groups" for management * Re-lock `poetry.lock`, pinning all dependencies to the latest version allowed by `pyproject.toml` * Enable `pydantic.mypy` plugin so that mypy upgrade is successful
1 parent 9460e5c commit 98ebb01

File tree

4 files changed

+532
-437
lines changed

4 files changed

+532
-437
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ ENV PIP_NO_CACHE_DIR=off \
1111
ENV PATH="$POETRY_HOME/bin:$PATH"
1212

1313
# Install Poetry - respects $POETRY_VERSION & $POETRY_HOME
14-
ENV POETRY_VERSION=1.3.2
15-
RUN curl -sSL https://install.python-poetry.org | python3 -
14+
RUN python3 -m venv $POETRY_HOME && \
15+
$POETRY_HOME/bin/pip install poetry==1.4.0 && \
16+
$POETRY_HOME/bin/poetry --version
1617

1718
# We copy our Python requirements here to cache them
1819
# and install only runtime deps using poetry
1920
WORKDIR $PYSETUP_PATH
2021
COPY ./poetry.lock ./pyproject.toml ./
21-
RUN poetry install --no-dev --no-root
22+
RUN $POETRY_HOME/bin/poetry install --without dev --no-root
2223

2324
# `production` stage uses the dependencies downloaded in the `base` stage
2425
FROM python:3.11.2-slim as production

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ clean:
3737
install: $(INSTALL_STAMP)
3838
$(INSTALL_STAMP): poetry.lock
3939
@if [ -z $(shell command -v poetry 2> /dev/null) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
40-
POETRY_VIRTUALENVS_IN_PROJECT=1 poetry install --no-root
40+
POETRY_VIRTUALENVS_IN_PROJECT=1 poetry install --with dev --no-root
4141
touch $(INSTALL_STAMP)
4242

4343
.PHONY: build

0 commit comments

Comments
 (0)