From c7ae920a774f3e474ce4296e80d08a829b1f8976 Mon Sep 17 00:00:00 2001 From: burtenshaw Date: Mon, 20 Oct 2025 06:51:52 +0200 Subject: [PATCH 1/2] add check for linux on cpu --- pyproject.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8d2c8f0..78873e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,3 +43,14 @@ testpaths = ["tests"] python_files = ["test_*.py"] python_classes = ["Test*"] python_functions = ["test_*"] + +# target torch to cuda 12.8 +[tool.uv.sources] +torch = [ + { index = "pytorch-cu128", marker = "platform_system == 'linux'"}, +] + +[[tool.uv.index]] +name = "pytorch-cu128" +url = "https://download.pytorch.org/whl/cu128" +explicit = true \ No newline at end of file From 0abb0fa2e3e27a455ca6bbcc581747c79c4ba263 Mon Sep 17 00:00:00 2001 From: burtenshaw Date: Mon, 20 Oct 2025 10:44:07 +0200 Subject: [PATCH 2/2] add both sides of the source check --- pyproject.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 78873e8..26625fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,9 +47,15 @@ python_functions = ["test_*"] # target torch to cuda 12.8 [tool.uv.sources] torch = [ - { index = "pytorch-cu128", marker = "platform_system == 'linux'"}, + { index = "pytorch-cpu", marker = "sys_platform != 'linux'" }, + { index = "pytorch-cu128", marker = "sys_platform == 'linux'" }, ] +[[tool.uv.index]] +name = "pytorch-cpu" +url = "https://download.pytorch.org/whl/cpu" +explicit = true + [[tool.uv.index]] name = "pytorch-cu128" url = "https://download.pytorch.org/whl/cu128"