Skip to content
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

Allow local version mismatches when validating lockfile #12285

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Mar 18, 2025

Summary

Closes #12282.

Test Plan

Given:

[project]
name = "foo"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13.0"
dependencies = ["flash-attn"]

[tool.uv]
environments = ["sys_platform == 'darwin'", "sys_platform == 'linux'"]
constraint-dependencies = ["torch==2.5.1"]

[tool.uv.sources]
flash_attn = [
  { url = "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.5cxx11abiFalse-cp310-cp310-linux_x86_64.whl", marker = "sys_platform == 'linux' and python_version == '3.10'"},
  { url = "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.5cxx11abiFalse-cp311-cp311-linux_x86_64.whl", marker = "sys_platform == 'linux' and python_version == '3.11'"},
  { url = "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.5cxx11abiFalse-cp312-cp312-linux_x86_64.whl", marker = "sys_platform == 'linux' and python_version == '3.12'"},
  { url = "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.5cxx11abiFalse-cp313-cp313-linux_x86_64.whl", marker = "sys_platform == 'linux' and python_version == '3.13'"}
]

Ran uv lock on v0.6.5. Then verified that uv lock fails on v0.6.6 on the same lockfile, but this commit succeeds.

@charliermarsh charliermarsh added the bug Something isn't working label Mar 18, 2025
@@ -2874,7 +2874,7 @@ impl PackageWire {
// Consistency check
if let Some(version) = &self.id.version {
for wheel in &self.wheels {
if version != &wheel.filename.version {
if version != &wheel.filename.version && version != &wheel.filename.version.clone().without_local() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if version.without_local() != &wheel.filename.version.without_local() to be fully permissive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to allow mismatching locals -- we don't do that elsewhere, at least? I think it would error elsewhere, like when we install.

@charliermarsh charliermarsh marked this pull request as ready for review March 18, 2025 15:04
@charliermarsh charliermarsh enabled auto-merge (squash) March 18, 2025 15:04
@charliermarsh charliermarsh merged commit faf16c1 into main Mar 18, 2025
75 of 76 checks passed
@charliermarsh charliermarsh deleted the charlie/local branch March 18, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv rejects flash-attn wheels with local versions
2 participants