Skip to content

Support different versions of the same package installed based on the markers in the --only-lock mode #15

@yurijmikhalevich

Description

@yurijmikhalevich

For example, I have in my pyproject.toml:

torch = [
  { version = "==2.0.1", source = "pypi", markers = "sys_platform != 'linux' or platform_machine == 'aarch64'" },
  { version = "==2.0.1+cpu", source = "pytorch-cpu", markers = "sys_platform == 'linux' and platform_machine != 'aarch64'" }
]
torchvision = [
  { version = "==0.15.2", source = "pypi", markers = "sys_platform != 'linux' or platform_machine == 'aarch64'" },
  { version = "==0.15.2+cpu", source = "pytorch-cpu", markers = "sys_platform == 'linux' and platform_machine != 'aarch64'" }
]

And poetry build generates:

Requires-Dist: torch (==2.0.1) ; sys_platform != "linux" or platform_machine == "aarch64"
Requires-Dist: torch (==2.0.1+cpu) ; sys_platform == "linux" and platform_machine != "aarch64"
Requires-Dist: torchvision (==0.15.2) ; sys_platform != "linux" or platform_machine == "aarch64"
Requires-Dist: torchvision (==0.15.2+cpu) ; sys_platform == "linux" and platform_machine != "aarch64"

But poetry blixbuild --only-lock generates (when built on macOS):

Requires-Dist: torch (==2.0.1)
Requires-Dist: torchvision (==0.15.2)

poetry blixbuild includes both versions, but I would love to fix all the versions to the ones specified in the poetry.lock and have the wheel installable on both Linux and non-Linux OSes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions