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

poetry export > requirements.txt without a virtualenv produces an invalid requirements file #6347

Closed
3 tasks done
andreareina opened this issue Sep 2, 2022 · 4 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@andreareina
Copy link

andreareina commented Sep 2, 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).

Issue

Starting with v1.2.0 poetry export creates a virtualenv if one is not already present. This causes a message ("Creating virtualenv ...") to be printed to stdout and so results in an invalid requirements file. We run poetry export > requirements.txt as part of a CI/CD build so there isn't an existing virtualenv.

/tmp/poetry-repro $ docker build -t poetry-repro .
Sending build context to Docker daemon  16.77MB
Step 1/3 : FROM public.ecr.aws/lambda/python:3.8
 ---> 247b5632d3d3
Step 2/3 : COPY pyproject.toml .
 ---> Using cache
 ---> 2a74b8c9b9a7
Step 3/3 : COPY poetry.lock .
 ---> Using cache
 ---> d92fc10d399b
Successfully built d92fc10d399b
Successfully tagged poetry-repro:latest

/tmp/poetry-repro $ docker run --rm -aSTDOUT --entrypoint /bin/bash poetry-repro -c "pip3 install 'poetry<1.2.0' > /dev/null && poetry --version && poetry export | head"
Poetry version 1.1.15
bottle==0.12.23

/tmp/poetry-repro $ docker run --rm -aSTDOUT --entrypoint /bin/bash poetry-repro -c "pip3 install 'poetry==1.2.0' > /dev/null && poetry --version && poetry export | head"
Poetry (version 1.2.0)
Creating virtualenv poetry-repro-AsW4q1BB-py3.8 in /root/.cache/pypoetry/virtualenvs
bottle==0.12.23 ; python_version >= "3.8" and python_version < "4.0"
@andreareina andreareina added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 2, 2022
@kigawas
Copy link

kigawas commented Sep 2, 2022

Same here. Creating virtualenv ... breaks lots of build

@finswimmer
Copy link
Member

Hey,

the export command is now a plugin and is developed in it's own repository: https://github.com/python-poetry/poetry-plugin-export

There this was already reported in python-poetry/poetry-plugin-export#78

fin swimmer

@andreareina
Copy link
Author

Thanks, I saw somewhere that it had gotten split out to a plugin, didn't realize that meant a new repo.

Future searchers: replace > requirements.txt with --output requirements.txt

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Sep 18, 2022
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