Skip to content

Commit 4e1070f

Browse files
authored
build: deprecate cpu and gpu extras (#155)
1 parent 9e4c057 commit 4e1070f

File tree

4 files changed

+126
-269
lines changed

4 files changed

+126
-269
lines changed

.github/workflows/run-tests-cpu.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ jobs:
3030
python-version: '3.10'
3131

3232
- name: Setup | dependencies
33-
run: uv sync --frozen --extra cpu
33+
run: |
34+
uv sync --frozen --only-group dev --only-group docs
35+
uv pip install --index-strategy unsafe-first-match torch==2.6.0+cpu torchvision==0.21.0+cpu . --extra-index-url https://download.pytorch.org/whl/cpu
36+
3437
- name: Run tests
3538
run: uv run --no-sync pytest tests/
3639

.github/workflows/run-tests-gpu.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
python-version: '3.10'
3838

3939
- name: Setup | dependencies
40-
run: uv sync --frozen --extra gpu
40+
run: |
41+
uv sync --frozen --only-group dev --only-group docs
42+
uv pip install .
4143
4244
- name: Setup | Check for available GPU-s
4345
run: nvidia-smi

pyproject.toml

-25
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ dependencies = [
4242
"torch>=2.6.0",
4343
]
4444

45-
[project.optional-dependencies]
46-
gpu = [
47-
"torch>=2.6.0",
48-
]
49-
cpu = [
50-
"torch==2.6.0+cpu; sys_platform == 'linux'",
51-
"torch>=2.6.0; sys_platform != 'linux'",
52-
]
53-
5445
[project.urls]
5546
homepage = "https://github.com/mostly-ai/mostlyai-qa"
5647
repository = "https://github.com/mostly-ai/mostlyai-qa"
@@ -76,22 +67,6 @@ docs = [
7667

7768
[tool.uv]
7869
default-groups = ["dev", "docs"]
79-
conflicts = [
80-
[
81-
{ extra = "cpu" },
82-
{ extra = "gpu" },
83-
],
84-
]
85-
86-
[[tool.uv.index]]
87-
name = "pytorch-cpu"
88-
url = "https://download.pytorch.org/whl/cpu"
89-
explicit = true
90-
91-
[tool.uv.sources]
92-
torch = [
93-
{ index = "pytorch-cpu", extra = "cpu", marker = "sys_platform == 'linux'"},
94-
]
9570

9671
[tool.hatch.build.targets.sdist]
9772
include = ["mostlyai/qa"]

0 commit comments

Comments
 (0)