Skip to content

Cannot generate lock file when specifying multiple platform-dependent wheels for a package #5714

@alasdairtran

Description

@alasdairtran
  • I am on the latest Poetry version on the master branch.
  • 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: Ubuntu 18.04.6 LTS
  • Poetry version: current master branch
  • Link of a Gist with the contents of your pyproject.toml file: See below

Issue

Here's the pyproject.toml lock file to reproduce the error

[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "~3.10.4"
jaxlib = [
    {url = "https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.3.10+cuda11.cudnn82-cp310-none-manylinux2014_x86_64.whl", platform = "linux"},
    {url = "https://storage.googleapis.com/jax-releases/mac/jaxlib-0.3.10-cp310-none-macosx_10_9_x86_64.whl", platform = "darwin" },
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.masonry.api"

Using the latest commit from master:

pipx install --suffix=@master 'poetry@git+https://github.com/python-poetry/poetry.git@master'
poetry@master lock

generating the lock file fails with error

  SolverProblemError

  Because test depends on both jaxlib (0.3.10+cuda11.cudnn82 url) and jaxlib (0.3.10 url), version solving failed.

  at ~/.local/pipx/venvs/poetry@master/lib/python3.10/site-packages/poetry/puzzle/solver.py:159 in _solve
      155│             packages = result.packages
      156│         except OverrideNeeded as e:
      157│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      158│         except SolveFailure as e:
    → 159│             raise SolverProblemError(e)
      160│
      161│         combined_nodes = depth_first_search(PackageNode(self._package, packages))
      162│         results = dict(aggregate_package_nodes(nodes) for nodes in combined_nodes)
      163│

I believe the commit that introduces the error is b7acf88 since if we roll back to the commit before that,

pipx install --suffix=@f9e7f 'poetry@git+https://github.com/python-poetry/poetry.git@f9e7f0d1339c2f05443115ab0b55d17176ad077f'
poetry@f9e7f lock

poetry can generate the lock file again.

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