python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.17k stars 2.25k forks source link

Explicit setuptools dep breaks poetry export #2842

Closed AstraLuma closed 4 years ago

AstraLuma commented 4 years ago

Issue

When setuptools is an explicit transitive dependency, the exported requirements.txt is not installable.

In this case, by zope.interface (which I believe is channels->daphne->twisted->zope.interface).

From my Dockerfile:

FROM python:3 AS builder
RUN pip install poetry
RUN mkdir /project /output
COPY . /project
WORKDIR /project
RUN poetry build -f wheel
RUN cp dist/*.whl /output
RUN poetry export -f requirements.txt -o /output/requirements.txt
WORKDIR /output
RUN pip download -r requirements.txt setuptools

The pip download fails with:

Collecting setuptools
ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    setuptools from https://files.pythonhosted.org/packages/c3/a9/5dc32465951cf4812e9e93b4ad2d314893c2fa6d5f66ce5c057af6e76d85/setuptools-49.6.0-py3-none-any.whl#sha256=4dd5bb0a0a0cff77b46ca5dd3a84857ee48c83e8223886b556613c724994073f (from zope.interface==5.1.0->-r requirements.txt (line 240))

Aside: I do not see setuptools locked in poetry.lock even though it is a run-time dependency.

The work around is to add --without-hashes to poetry export.

AstraLuma commented 4 years ago

Oops, this is a duplicate of #1584

github-actions[bot] commented 6 months ago

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.