Skip to content

Platform-Specific Dependencies in requirements.in Not Working as Expected with --universal #8915

@ewianda

Description

@ewianda

Description:
When specifying platform-specific dependencies in requirements.in for optimum[onnxruntime] and optimum[onnxruntime-gpu], the generated requirements.txt file consolidates dependencies inappropriately. Specifically, optimum[onnxruntime-gpu]; sys_platform == 'linux' and optimum[onnxruntime]; sys_platform == 'darwin' results in optimum[onnxruntime,onnxruntime]==1.18; sys_platform == 'linux' in the output requirements.txt, which causes the Darwin platform dependency to be ignored.

Steps to Reproduce:

  1. Create a requirements.in file with the following lines:
    optimum[onnxruntime-gpu]; sys_platform == 'linux'
    optimum[onnxruntime]; sys_platform == 'darwin'
    
  2. Run uv pip compile --universal requirements.in to generate requirements.txt.
  3. Open the resulting requirements.txt.

Expected Behavior:
requirements.txt should list both platform-specific dependencies separately, like:

optimum[onnxruntime-gpu]==1.18; sys_platform == 'linux'
optimum[onnxruntime]==1.18; sys_platform == 'darwin'

Actual Behavior:
The generated requirements.txt incorrectly merges dependencies, resulting in:

optimum[onnxruntime,onnxruntime-gpu]==1.18; sys_platform == 'linux'

This line omits the macOS (Darwin) dependency entirely.

Environment:

  • uv version: 0.4.30

  • Operating System: Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy