Skip to content

Use venvs with poetry in Dockerfile#2268

Merged
HassanAbouelela merged 4 commits into
mainfrom
pin-poetry-to-1.1.X
Sep 12, 2022
Merged

Use venvs with poetry in Dockerfile#2268
HassanAbouelela merged 4 commits into
mainfrom
pin-poetry-to-1.1.X

Conversation

@ChrisLovering
Copy link
Copy Markdown
Member

@ChrisLovering ChrisLovering commented Sep 1, 2022

This is due to a regression in poetry 1.2.0, see HassanAbouelela/actions#7

Without this change, CI is currently failing to install deps, due to us using user-based installs.

HassanAbouelela
HassanAbouelela previously approved these changes Sep 1, 2022
D0rs4n
D0rs4n previously approved these changes Sep 1, 2022
@ChrisLovering ChrisLovering added the review: do not merge The PR can be reviewed but cannot be merged now label Sep 1, 2022
@ChrisLovering ChrisLovering removed the review: do not merge The PR can be reviewed but cannot be merged now label Sep 1, 2022
@ChrisLovering ChrisLovering dismissed stale reviews from D0rs4n and HassanAbouelela September 1, 2022 21:46

Stale

@ChrisLovering ChrisLovering changed the title Pin poetry to 1.1.15 in Dockerfile Use venvs with poetry in Dockerfile Sep 1, 2022
Copy link
Copy Markdown
Contributor

@ionite34 ionite34 left a comment

Choose a reason for hiding this comment

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

CI code looks good.

Copy link
Copy Markdown
Contributor

@shenanigansd shenanigansd left a comment

Choose a reason for hiding this comment

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

Docker image builds successfully

Copy link
Copy Markdown
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

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

Can't say I know fully what's happening but the checks on this PR aren't failing, which is better than what we have on main :P

@wookie184 wookie184 added t: bug Something isn't working p: 0 - critical Needs to be addressed ASAP a: tools Development related to our toolchain (Docker, pipenv, flake8) s: needs review Author is waiting for someone to review and approve labels Sep 10, 2022
@python-discord-policy-bot python-discord-policy-bot Bot requested a review from a team September 10, 2022 18:02
Comment thread Dockerfile Outdated
@ChrisLovering ChrisLovering force-pushed the pin-poetry-to-1.1.X branch 2 times, most recently from 2ece958 to f413776 Compare September 10, 2022 19:06
This is required due to a regression in poetry, see HassanAbouelela/actions#7
@ChrisLovering ChrisLovering force-pushed the pin-poetry-to-1.1.X branch 2 times, most recently from 99c742a to c2f3736 Compare September 11, 2022 00:20
Comment thread docker-compose.yml Outdated
dockerfile: Dockerfile
volumes:
- .:/bot:ro
- ./bot:/bot/bot:ro
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why was this change made, don’t we still want the other files and directories such as tests and configs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was made because I was putting the venv inside APP_DIR, causing venv on host to overwrite it with this volume.

It's not needed now though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dropped the commit that added this

Instead let poetry install the venv for the project in the right place, leading to a more 'traditional' poetry setup.
@HassanAbouelela HassanAbouelela merged commit 7adc758 into main Sep 12, 2022
@HassanAbouelela HassanAbouelela deleted the pin-poetry-to-1.1.X branch September 12, 2022 21:25
HassanAbouelela added a commit that referenced this pull request Sep 17, 2022
Poetry 1.2 introduced a regression which broke pip `--user` installs.
These types of install were the main way we did installations in docker
and CI, as they made it much more convenient to control the location,
availability, and caching of packages.

Poetry's team does not recognize this as a supported use case, so major
changes were required to get everything working again. Most of the
changes were consolidated into chrislovering/python-poetry-base for
docker, and HassanAbouelela/setup-python for CI.

This is a follow-up to #2268 and #2276.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tools Development related to our toolchain (Docker, pipenv, flake8) p: 0 - critical Needs to be addressed ASAP s: needs review Author is waiting for someone to review and approve t: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants