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.

Option to bypass version resolving on specific dependency

See original GitHub issue

Say I have an app that have to be runnable on these boxes:

  • Ubuntu, with CUDA 11.4 (which requires the cu111 version)
  • Ubuntu, with CUDA 10.2 (cu111 doesn’t work)
  • Ubuntu, CPU only
  • MacOS

If only for Linux and MacOS, we can use environment markers such as:

torch = [
  {version = "1.8.1", markers = "sys_platform == 'linux'"},
  {version = "1.8.1", markers = "sys_platform == 'darwin'"}
]

But there’re no options for different CUDA versions.

PROPOSAL:

[tool.poetry.dependencies]
#...
torch = {version = "1.8.1", resolve = False}
#...

For production Docker image: Since pytorch with cuda is big (e.g. torch-1.9.1+cu111-cp38-cp38-linux_x86_64.whl is 2GB). Downloading 2GB for frequent builds (CI/CD) is a wast of time, so I built base Docker images with different pytorch/CUDA version. With pip install -r requirements.txt, it detects the pytorch dep is already fit, and moves on. Expecting an option to have poetry install to treat pytorch as fit as well.

For local dev env: Just run the plain pip install xxxx only once for the venv manually, or in poe plugin, if the default one does not fit.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
finswimmercommented, Jul 29, 2022

Hello @orctom,

without resolving the dependencies, Poetry cannot create a lock file. But this is a core functionality. This is why it is very unlikely that we will implement something like you suggest.

fin swimmer

0reactions
neersightedcommented, Oct 25, 2022

Poetry is a voulenteer-maintained project. If it is not suitable for your use case, no one is forcing you to use it, or selling it to you. We are as interoperable with the rest of the ecosystem as we can be; there are no major barriers to other solutions, if they are more appropriate for you.

The simple matter is that no one who regularly works on Poetry or that is deeply familiar with the code is interested in solving this; until someone interested and motivated to get a design that meets your needs steps up, no amount of berating the Poetry maintainers and community will grant your ask.

We’re off-topic for this issue, please direct any more discussion of dependency constraint overrides to #697.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gemfile option to bypass dependency checks - Stack Overflow
We are trying to install rubygems.org/gems/oci . It has a dependency on ruby version 2.2.0, however in our stack we are using 2.1.6...
Read more >
How to override your dependency's dependencies (Node.js)
Override and enforce dependency versions using npm "overrides".
Read more >
tell yum to ignore a single dependency - Server Fault
Generally yum doesn't have options to ignore a single package from the dependencies. Option --skip-broken ignores all unresolved dependences ...
Read more >
How to Prevent and Fix Package Dependency Errors in Ubuntu
Package dependency errors can occur in Ubuntu after installing some apps. ... to solve conflicts, with multiple options that can be selected by...
Read more >
Overriding Dependency Versions and Using Version Ranges ...
Like most languages, Java only allows a single version of a ... “solve” for the required version of a build's dependency given that...
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