Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Pin poetry.core in Docker images #12853

Merged
merged 5 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12853.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the docker file after a dependency update.
Copy link
Contributor

@MadLittleMods MadLittleMods May 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changelog entry is not very descriptive and doesn't explain why we made the change (what was broken before).

For reference, these changes are spawning from some discussion in #synapse-dev:matrix.org which discusses the ModuleNotFoundError: No module named 'matrix_common' errors popping up when Complement is running in CI.

As far as I can tell, the dependency was missing in CI because of this reason mentioned in the room discussion:

hmm, the lockfile is changing all deps to from main to dev category :/
Yeah, that seems to be the problem, as export ignores dev deps by default :/

-- @erikjohnston

As the issue description already mentions, the root cause might be because we didn't pin poetry-core before and it was pulling in a recent beta release which introduced the unexpected problem behavior. In any case, pinning to poetry-core==1.1.0a7 makes it work as expected to install all of the deps.


This information should also be in the PR description. I'm not confident in my conclusion here to update it myself.

better PR subject and description please. The current ones will make zero sense in a few months time 😇

-- @richvdh, #12853 (comment)

8 changes: 1 addition & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,11 @@ RUN \

# We install poetry in its own build stage to avoid its dependencies conflicting with
# synapse's dependencies.
# We use a specific commit from poetry's master branch instead of our usual 1.1.12,
# to incorporate fixes to some bugs in `poetry export`. This commit corresponds to
# https://github.com/python-poetry/poetry/pull/5156 and
# https://github.com/python-poetry/poetry/issues/5141 ;
# without it, we generate a requirements.txt with incorrect environment markers,
# which causes necessary packages to be omitted when we `pip install`.
#
# NB: In poetry 1.2 `poetry export` will be moved into a plugin; we'll need to also
# pip install poetry-plugin-export (https://github.com/python-poetry/poetry-plugin-export).
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --user git+https://github.com/python-poetry/poetry.git@fb13b3a676f476177f7937ffa480ee5cff9a90a5
pip install --user "poetry==1.1.3"
babolivier marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /synapse

Expand Down