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

Resolver fails on URL dependencies for different installations #4045

Closed
3 tasks done
MetcalfeTom opened this issue May 6, 2021 · 3 comments
Closed
3 tasks done

Resolver fails on URL dependencies for different installations #4045

MetcalfeTom opened this issue May 6, 2021 · 3 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@MetcalfeTom
Copy link

MetcalfeTom commented May 6, 2021

  • 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: macOS Big Sur 11.2.3

  • Poetry version: 1.1.6

Issue

When building a first package with a URL dependency, any other package depending on it fails when specifying a version

Example:

[tool.poetry]
name = "some_package"
version = "2.0.0"

[tool.poetry.dependencies]
torch = { url = "https://download.pytorch.org/whl/cu110/torch-1.7.1%2Bcu110-cp38-cp38-linux_x86_64.whl" }

Now depending on that package and specifying a version of torch:

[tool.poetry]
name = "some_other_package"
version = "2.0.0"

[tool.poetry.dependencies]
some_package = "2.0.0"
torch = "*"

Leads to the following:

SolverProblemError

Because some_other_package depends on some_package (2.0.0) which depends on torch (1.7.1+cu110), torch is required.
So, because some_other_package depends on torch (*), version solving failed.

This makes it impossible to support multiple-constraint dependencies that contain URLs, which was something I attempted as a solution to #2613

@MetcalfeTom MetcalfeTom added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 6, 2021
@MetcalfeTom
Copy link
Author

I'd like to work on this issue

As I see it, the problem arises in poetry-core due to the PackageSpecification.is_same_package_as() function being too stringent on URLs:

https://github.com/python-poetry/poetry-core/blob/58138c580210c473190f0513d6f1f6f0a86f6255/poetry/core/packages/specification.py#L67-L77

Would it be suitable to override this method for URLDependency with some reference to the version/constraint of the package instead of checking the URL matches?

@python-poetry/triage

@dimbleby
Copy link
Contributor

dimbleby commented Jun 4, 2023

works now, please close

@Secrus Secrus closed this as completed Jun 4, 2023
Copy link

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 Feb 29, 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 status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants