Make torch an extra/dev dependency (#50)

To support use of this package when Torch is optional.
This commit is contained in:
Daniël de Kok
2025-03-20 10:18:19 +01:00
committed by GitHub
parent 22eaba2826
commit 5208ac4be5
2 changed files with 9 additions and 1 deletions

View File

@ -52,3 +52,8 @@ jobs:
- name: Run tests
run: uv run pytest tests
- name: Import check without torch
run: |
uv pip uninstall torch
python -c "import kernels"

View File

@ -14,7 +14,6 @@ dependencies = [
"huggingface-hub>=0.26.3",
"packaging>=24.2",
"tomli>=2.0.1; python_version<'3.11'",
"torch>=2.5",
]
[build-system]
@ -27,8 +26,12 @@ dev = [
"pytest >=8",
# Whatever version is compatible with pytest.
"pytest-benchmark",
"torch >=2.5",
]
[project.optional-dependencies]
torch = ["torch"]
[project.scripts]
kernels = "kernels.cli:main"