Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install inside github actions fails with poetry==1.2.0 #6397

Closed
3 tasks done
fruch opened this issue Sep 4, 2022 · 3 comments
Closed
3 tasks done

install inside github actions fails with poetry==1.2.0 #6397

fruch opened this issue Sep 4, 2022 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@fruch
Copy link

fruch commented Sep 4, 2022

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Docker build inside github actions

  • Poetry version: 1.2.0

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/fruch/e29e311e8edfe390acdd55f09f6102ea

Issue

running poetry install inside docker build when running on github action started failing once 1.2.0 was released: (4 days ago)

Dockerfile:

FROM python:3.10.6-bullseye
...
RUN poetry config virtualenvs.create false && poetry install --only main --no-root

the command returned with status code 1, without anymore information
adding

full log of the github action with -vvv:
https://gist.github.com/fruch/f4d542dba9533eb3a31b9824e7cfb102

locally on people's laptops this command was working just fine (including inside the docker build)

adding the following command, elevated the issue:

poetry config installer.max-workers 2

seems that the default number_of_cpus + 4 is problematic inside github action that has 2 cores only.

But couldn't figure exactly why...

@fruch fruch added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 4, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Sep 4, 2022

you seem to be installing poetry system 1.2.0 system-wide, and then also system-wide installing a package that has an explicit dependency on poetry 1.1.13.

Probably it's obvious that this is a bad idea, I'm surprised it works ever.

@neersighted
Copy link
Member

Both Poetry and your project need to be installed in to their own virtual environments -- please take a look at the following pattern in Docker for a minimal way to install Poetry and a package:

FROM python:3.10

ENV POETRY_HOME=/opt/poetry
RUN python3 -m venv $POETRY_HOME && \
    $POETRY_HOME/bin/pip install poetry==1.2.0

RUN git clone https://github.com/python-poetry/poetry /poetry

WORKDIR /poetry

ENV VIRTUAL_ENV=/poetry-env \
    PATH="/poetry-env/bin:$POETRY_HOME/bin:$PATH"

RUN python3 -m venv $VIRTUAL_ENV && \
    poetry install
    
CMD "pytest"

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants