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

Export fails to take proper care of extra in deps with more than one path #5537

Closed
3 tasks done
shaib opened this issue May 4, 2022 · 4 comments · Fixed by #5725
Closed
3 tasks done

Export fails to take proper care of extra in deps with more than one path #5537

shaib opened this issue May 4, 2022 · 4 comments · Fixed by #5725
Labels
kind/bug Something isn't working as expected

Comments

@shaib
Copy link

shaib commented May 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: Debian testing (bookworm, i.e. on the way to 12.0)

  • Poetry version: 1.1.13 installed from pip

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/shaib/3bd014dd9cfe39faf23dcd1363da9a2d

Issue

Starting from scratch, adding one dependency which requires google-api-core[grpc] and another which constrains google-api-core (the real project is of course significantly more complex and the limit is derived), all is well as long as we're in poetry; but when exported, even though all the chain of dependencies seems to be exported, it seems that the extra designation itself is not; and the result is, that when we try to pip install from the requirements file, we get

ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    google-api-core[grpc]<2.0.0dev,>=1.14.0 from ... (from firebase-admin==4.5.3->-r requirements.txt (line 13))

All the details -- a log of the session, the poetry add -vvv output, the pyproject.toml, poetry.lock and requirements.txt are in the gist listed above.

(edit: Running, in the above, the command

$ sed -i 's/google-api-core/google-api-core[grpc]/g' requirements.txt

allows pip to install everything)

#4912 seems to be closely related but I believe it is not the same issue.

@shaib shaib added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 4, 2022
@Secrus Secrus added status/triage This issue needs to be triaged and removed status/triage This issue needs to be triaged labels May 15, 2022
@Secrus
Copy link
Member

Secrus commented May 22, 2022

Hi. As with release 1.2, export is gonna be moved to plugin poetry-plugin-export, could you please check if this issue is still present with poetry 1.2 and plugin? If so, please report it in the plugin repository (linked above).

@Secrus Secrus removed the status/triage This issue needs to be triaged label May 22, 2022
@johnthagen
Copy link
Contributor

I hit a similar issue in Docker running poetry export with Poetry 1.1.13:

#0 167.7 Collecting cffi>=1.0.1
#0 167.7 ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
#0 167.7     cffi>=1.0.1 from https://files.pythonhosted.org/packages/e2/25/00fd291e0872d43dabe070e7b761ba37453a1a94bd6e28c31b73112d8f0c/cffi-1.15.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl#sha256=74fdfdbfdc48d3f47148976f49fab3251e550a8720bebc99bf1483f5bfb5db3e (from argon2-cffi-bindings==21.2.0->-r requirements.txt (line 10))

Installing Poetry 1.2.0b1 within Docker moved the problem to another location:

...
#0 214.1 Collecting pycparser
#0 214.2 ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
#0 214.2     pycparser from https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl#sha256=8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 (from cffi==1.15.0->-r requirements.txt (line 59))

The parts of the Dockerfile

# Change this to 1.2.0b1
ENV POETRY_VERSION 1.1.13

RUN pip install "poetry==${POETRY_VERSION}"

COPY pyproject.toml poetry.lock ./
RUN poetry export --output requirements.txt

RUN python -m venv ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"

RUN pip install --upgrade pip wheel && \
    pip install -r requirements.txt

@abn
Copy link
Member

abn commented May 26, 2022

This was resolved by #5688 and python-poetry/poetry-plugin-export#65

Copy link

github-actions bot commented Mar 2, 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 2, 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

Successfully merging a pull request may close this issue.

4 participants