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

Wrong hash is used for repeated tensorflow-text #7059

Closed
charliermarsh opened this issue Sep 5, 2024 · 1 comment · Fixed by #7060
Closed

Wrong hash is used for repeated tensorflow-text #7059

charliermarsh opened this issue Sep 5, 2024 · 1 comment · Fixed by #7060
Assignees
Labels
bug Something isn't working

Comments

@charliermarsh
Copy link
Member

Not sure it's exactly the same issue, but it is related, so adding it here.

Here is a simple pyproject.toml, on macOS:

[project]
name = "test_uv"
version = "0.0.1"
requires-python = ">=3.11;<3.12"
dependencies = [
  "tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.17/tensorflow_text-2.17.0-cp311-cp311-macosx_11_0_arm64.whl#sha256=f0a7225a1242f06e4d206235f56025a0f70fb9a2e3ecb85bd5ba686269e74c16 ; sys_platform == 'darwin'",
  "tensorflow-text; sys_platform == 'linux'",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.metadata]
allow-direct-references = true

an uv sync on this will fail with this message:

Resolved 41 packages in 352ms
error: Failed to prepare distributions
  Caused by: Failed to fetch wheel: tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.17/tensorflow_text-2.17.0-cp311-cp311-macosx_11_0_arm64.whl#sha256=f0a7225a1242f06e4d206235f56025a0f70fb9a2e3ecb85bd5ba686269e74c16
  Caused by: Hash mismatch for `tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.17/tensorflow_text-2.17.0-cp311-cp311-macosx_11_0_arm64.whl#sha256=f0a7225a1242f06e4d206235f56025a0f70fb9a2e3ecb85bd5ba686269e74c16`

Expected:
  sha256:ff3e9a8e19256e184a0e0997b189fa4a73bb00da74a109cef542e48073d99142

Computed:
  sha256:f0a7225a1242f06e4d206235f56025a0f70fb9a2e3ecb85bd5ba686269e74c16

Note that the computed is exactly as requested.

More important: Removing line 7, "tensorflow-text; sys_platform == 'linux'", allows uv to sync successfully.
The linux line should never be activated on macos; but somehow it tells uv to fetch the hash for the linux version of the wheel and create a wrong expectation.

I hope this is helpful.

Originally posted by @maparent in #6974 (comment)

@charliermarsh charliermarsh added the bug Something isn't working label Sep 5, 2024
@charliermarsh charliermarsh self-assigned this Sep 5, 2024
charliermarsh added a commit that referenced this issue Sep 5, 2024
## Summary

In resolving #7059, I noticed that
we left the fragment on the `source = { url = "..." }`.
@maparent
Copy link

maparent commented Sep 5, 2024

That was swift! Thanks a lot!

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 a pull request may close this issue.

2 participants