question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poetry exports incorrect requirements for transitive dependencies, breaks installation with hashes

See original GitHub issue
  • 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

This seems related to #3363, but I don’t believe it’s a duplicate, and I haven’t seen this mentioned elsewhere.

When exporting requirements.txt, poetry will add incorrect implementation markers to the output, which in some cases can result in invalid requirement files when used with hashes:

Collecting cffi>=1.0.0
ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    cffi>=1.0.0 from https://devpi.cerebras.aws/root/pypi/%2Bf/57e/9ac9ccc3101fa/cffi-1.15.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl#sha256=57e9ac9ccc3101fac9d6014fba037473e4358ef4e89f8e181f8951a2c0162024 (from argon2-cffi==21.1.0->-r /tmp/reqs.txt (line 16))

This happens because in the generated requirements.txt, the section for cffi is as follows:

cffi==1.15.0; implementation_name == "pypy" and python_version >= "3.6" \
    --hash=sha256:c2502a1a03b6312837279c8c1bd3ebedf6c12c4228ddbad40912d671ccc8a962 \
    --hash=sha256:23cfe892bd5dd8941608f93348c0737e369e51c100d03718f108bf1add7bd6d0 \
[...]
    --hash=sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954

Notice the implementation_name == "pypy" marker, even though the implementation used is CPython.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dimblebycommented, May 11, 2022

Having said which, this example actually exposes https://github.com/python-poetry/poetry/issues/5593, so thanks for that!

0reactions
dimblebycommented, May 15, 2022

anyway both the original issue and the new example are fixed on master, so probably this should be closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

History | Poetry - Python dependency management and ...
Fix an issue where a package from the wrong source was installed for a multiple-constraints dependency with different sources (#6747).
Read more >
Python poetry install failure - invalid hashes - Stack Overflow
There are several issue reports about invalid hashes. One common cause is running multiple Poetry instances simultaneously; ...
Read more >
Defining metadata (meta.yaml) - Conda
If you do not, the package hashes may use different values, and your package may not be testable, because the hashes will differ....
Read more >
PEP 665: Specifying Installation Requirements for Python ...
A listing of all indirect/transitive dependencies #. Specifying (at least) specific versions of dependencies for reproducible installations.
Read more >
Python has a lot of problems that really slow down ...
Python has a horrible dependency management system, from top-to-bottom. ... Unfortunately, you can't pip install poetry because it needs to manage packages, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found