-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
uv should skip parsing non-platform dependencies or sources #12331
Comments
|
Since |
Normally I would recommend adding a |
Thank you, @charliermarsh. Here's what I've tried:
Could you please help me understand why the package isn’t showing up? |
Can you explain what you mean by "no packages were listed", and/or provide me with exact steps I can take to reproduce? |
Steps to Reproduce# On Linux
mkdir example; cd example
uv init -p 3.12
uv add "git+https://github.com/NVIDIA/Megatron-LM; sys_platform == 'linux'"
# show current packages
uv tree -d2
# On Windows
mkdir example; cd example
uv init -p 3.12
# copy the above pyproject.toml and uv.lock generated on Linux to replace here
uv sync
uv tree -d2
uv add numpy --frozen
uv tree -d2 # This will throw error
uv tree -d2 --frozen # output: example v0.1.0
uv pip list # output nothing |
|
Thank you, @zanieb. |
Personally, uv should skip parsing non-platform dependencies or sources is a valid requirement :) |
I don't think we'll do that. The point of uv's lockfile is that it's platform independent and the problem is rather that this package is not following best practices for declaring metadata. |
Thank you for your assistance. |
The problem is that we need build the package to determine its metadata, but the package can only be built on Linux. Metadata can be declared statically, so the build does not need to happen. Or, they can build wheels for supported platforms, in which the resolved metadata can be stored. For background, see
The project is using a |
Thank you for the detailed explanation and the reference links. |
Summary
I have a
pyproject.toml
where I configure platform-specific dependencies and source settings as follows:On Linux, everything works fine. However, on Windows, running
uv sync
throws the following error:Steps to Reproduce
Expected Behavior
On non-target platforms (e.g., Windows), uv should skip parsing dependencies or sources that have platform-specific markers, thereby avoiding build errors.
FYI
The text was updated successfully, but these errors were encountered: