Skip to content

Instantly share code, notes, and snippets.

@zhukovgreen
Last active February 12, 2025 15:32
Show Gist options
  • Save zhukovgreen/923be42feb2f1d648da4057399b6148f to your computer and use it in GitHub Desktop.
Save zhukovgreen/923be42feb2f1d648da4057399b6148f to your computer and use it in GitHub Desktop.
uv multiplatform example
[project]
name = "cross-platform-torch-uv"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"torch==1.13.1 ; sys_platform == 'darwin'",
"torch==1.13.1+cpu ; sys_platform != 'darwin'",
]
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch" }
version = 1
requires-python = ">=3.10"
resolution-markers = [
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')",
"sys_platform == 'darwin'",
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
[[package]]
name = "cross-platform-torch-uv"
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "torch", version = "1.13.1", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform == 'darwin'" },
{ name = "torch", version = "1.13.1+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform != 'darwin'" },
]
[package.metadata]
requires-dist = [
{ name = "torch", marker = "sys_platform != 'darwin'", specifier = "==1.13.1+cpu", index = "https://download.pytorch.org/whl/cpu" },
{ name = "torch", marker = "sys_platform == 'darwin'", specifier = "==1.13.1", index = "https://download.pytorch.org/whl/cpu" },
]
[[package]]
name = "torch"
version = "1.13.1"
source = { registry = "https://download.pytorch.org/whl/cpu" }
resolution-markers = [
"sys_platform == 'darwin'",
]
dependencies = [
{ name = "typing-extensions", marker = "sys_platform == 'darwin'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp310-none-macosx_10_9_x86_64.whl", hash = "sha256:393a6273c832e047581063fb74335ff50b4c566217019cc6ace318cd79eb0566" },
{ url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp310-none-macosx_11_0_arm64.whl", hash = "sha256:0122806b111b949d21fa1a5f9764d1fd2fcc4a47cb7f8ff914204fd4fc752ed5" },
]
[[package]]
name = "torch"
version = "1.13.1+cpu"
source = { registry = "https://download.pytorch.org/whl/cpu" }
resolution-markers = [
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')",
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
dependencies = [
{ name = "typing-extensions", marker = "sys_platform != 'darwin'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cpu/torch-1.13.1%2Bcpu-cp310-cp310-linux_x86_64.whl", hash = "sha256:11692523b87c45b79ddfb5148b12a713d85235d399915490d94e079521f7e014" },
{ url = "https://download.pytorch.org/whl/cpu/torch-1.13.1%2Bcpu-cp310-cp310-win_amd64.whl", hash = "sha256:207ab3700cd9c4349f4fd1892597eb3d385eb78221c0f2974ec54b8ea903aa00" },
{ url = "https://download.pytorch.org/whl/cpu/torch-1.13.1%2Bcpu-cp311-cp311-linux_x86_64.whl", hash = "sha256:dc185f2fdbb1f84855929d3ba7b36c74f218789d26a0e0268cb0586d466c8c24" },
]
[[package]]
name = "typing-extensions"
version = "4.12.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438 },
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment