Skip to content

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

Closed

Description

@lypwig

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.

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Apr 14, 2022
  2. kmsquire commented on Apr 14, 2022

    @kmsquire

    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.

  3. lypwig commented on Apr 15, 2022

    @lypwig
    Author

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

  4. dimbleby commented on Apr 16, 2022

    @dimbleby
    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)

  5. lypwig commented on Apr 17, 2022

    @lypwig
    Author

    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.

  6. dimbleby commented on Apr 17, 2022

    @dimbleby
    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.

  7. github-actions commented on Mar 1, 2024

    @github-actions

    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.

  8. locked as resolved and limited conversation to collaborators on Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions