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

Poetry doesn't install the correct dependency according to its supported Python version #5447

Closed
3 tasks done
roipoussiere opened this issue Apr 14, 2022 · 6 comments · Fixed by #5715
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@roipoussiere
Copy link

Issue

I have a wheel dependency on specific url for many platforms (Linuw/macOS/Windows) and many Python version (3.8, 3.9, 3.10).

Despite the fact I use Python 3.9, when I try poetry install, the python 3.8 version of the wheel is downloaded.

I also tried to:

  • replace python = "^3.8" by python = "^3.9" (same thing);
  • replace python = "~3.8", markers = "platform_system == 'Linux'", by markers = "python_version ~= '3.8' and platform_system == 'Linux'", (same thing).

Maybe related to #5378 or #5205, I don't think it's the same issue but I'm not sure.

@roipoussiere roipoussiere added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 14, 2022
@kmsquire
Copy link

kmsquire commented Apr 14, 2022

I see a similar problem with something like the following:

package = [
  { platform = "linux", python = "~3.7.0", url = "https://some.url.com/path/to/package-cp37-cp37-linux_x86_64.whl" },
  { platform = "linux", python = "~3.8.0", url = "https://some.url.com/path/to/package-cp38-cp38-linux_x86_64.whl" },
  { platform = "linux", python = "~3.9.0", url = "https://some.url.com/path/to/package-cp39-cp39-linux_x86_64.whl" },
  { platform = "darwin", python = "~3.7.0", url = "https://some.url.com/path/to/package-cp37-cp37-macosx_10_14_x86_64.whl" },
  { platform = "darwin", python = "~3.8.0", url = "https://some.url.com/path/to/package-cp38-cp38-macosx_10_14_x86_64.whl" },
  { platform = "darwin", python = "~3.9.0", url = "https://some.url.com/path/to/package-cp39-cp39-macosx_10_14_x86_64.whl" },
]

In this case, poetry attempts to install only the first URL--if I look at poetry.lock, I see something like

[[package]]
name = "package"
version = "1.2.3"
description = ""
category = "main"
optional = false
python-versions = "*"

[package.source]
type = "url"
url = "https://some.url.com/path/to/package-cp37-cp37-linux_x86_64.whl"

So, poetry only stores a single URL in the lock file, despite there being multiple URLs specified in pyproject.toml

EDIT: The python versions above were incorrect (i.e., previously, it had "~3.7", but it should have been "~3.7.0"). I've fixed it now. Unfortunately, that doesn't fix the behavior.

@roipoussiere
Copy link
Author

If I use the { platform = "linux", python = "~3.8", url = ...} approach, Poetry doesn't even try to download the wheel. 🤔

@dimbleby
Copy link
Contributor

@roipoussiere it looks as though you have now published ocp-vtk to pypi, so you should be able simply to go: ocp-vtk = "^7.5.3" - right?

Not to say that this isn't a valid bug report - possibly poetry should do a better job with the list of urls and markers that you were using. But I expect that the main line case should work just fine with different python versions and platforms and so on.

(by the way the pyproject.toml that you linked to is broken, it has a whole series of dead urls because you have ocpvtk where you want ocp_vtk)

@roipoussiere
Copy link
Author

roipoussiere commented Apr 17, 2022

it looks as though you have now published ocp-vtk to pypi, so you should be able simply to go: ocp-vtk = "^7.5.3" - right?

Yes, I don't need to specify wheel urls now.

by the way the pyproject.toml that you linked to is broken, it has a whole series of dead urls because you have ocpvtk where you want ocp_vtk

fixed, thanks.

Not to say that this isn't a valid bug report

I don't understand why this isn't a valid bug report. Poetry downloads the wrong wheel according to my python version, this is not an expected behavior, so I made a bug report.

Since the dependency is published on PyPI I don't personally need a response now, so feel free to close this if you think is not relevant.

@dimbleby
Copy link
Contributor

Not to say that this isn't a valid bug report

I don't understand why this isn't a valid bug report.

Apologies if my double-negative confused you. We are agreeing.

Copy link

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