From a7f6cec88824d942b13a730e8b6048e5475c41fd Mon Sep 17 00:00:00 2001 From: Jeroen Van Goey Date: Wed, 18 Nov 2026 09:13:08 +0200 Subject: [PATCH 1/4] chore: support Python 3.10-3.13, numba >= 0.61 with numba-cuda, and matchms 0.34 - requires-python >=3.10,<3.14 (was >=3.8,<3.13): numba >= 0.61 needs 3.10. - numba >= 0.61 and numba-cuda as dependencies. Numba's built-in CUDA target is deprecated in favour of NVIDIA's numba-cuda, which numba >= 0.61 uses automatically; numba 0.59's built-in driver bindings segfault creating a context on recent drivers. Extras cu12 / cu13 install NVVM and libdevice from pip. - numpy and sparsestack declared: SimMS imports both directly. - Tests: matchms 0.34 renamed ModifiedCosine to ModifiedCosineGreedy; import either. - CI tests Python 3.10, 3.11, 3.12 and 3.13 (was 3.9 only). - README: pip install with the CUDA extra; a current PyTorch image for Docker. --- .github/workflows/python-package.yml | 2 +- README.md | 27 ++++++++++--------- pyproject.toml | 15 ++++++++++- .../similarity/test_matchms_compatibility.py | 5 +++- tests/stress/test_stress.py | 6 ++++- 5 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 12fe252..22ce9cc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9"] #, "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index fcd30b7..b8f646e 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,12 @@ The `pytorch/pytorch:2.2.1-cuda12.1-cudnn8-devel` docker [image](https://hub.doc ## Install ```bash -pip install git+https://github.com/PangeAI/simms +# Pick the extra matching your CUDA driver: cu12 or cu13 +pip install "simms[cu12] @ git+https://github.com/PangeAI/simms" ``` +The `cu12` / `cu13` extra installs the CUDA compiler pieces Numba needs (NVVM, libdevice) from pip, through [numba-cuda](https://github.com/NVIDIA/numba-cuda). Without an extra, Numba uses a CUDA toolkit installed on the system. + ## Use with MatchMS ```py @@ -106,30 +109,28 @@ The **easiest way** to get started is to use the =0.24", + "numba>=0.61", + "numba-cuda>=0.30", + "numpy>=1.24", + "sparsestack>=0.5", "torch>=2.0.0", "tqdm>=4.66.4", "joblib>=1.4.0", @@ -23,6 +27,10 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] keywords = [ "similarity measures", @@ -32,6 +40,11 @@ keywords = [ "CUDA", ] +[project.optional-dependencies] +# NVVM, libdevice and the CUDA runtime from pip wheels, instead of a system or conda CUDA toolkit. +cu12 = ["numba-cuda[cu12]>=0.30"] +cu13 = ["numba-cuda[cu13]>=0.30"] + [project.urls] homepage = "https://github.com/PangeAI/simms" repository = "https://github.com/PangeAI/simms" diff --git a/tests/similarity/test_matchms_compatibility.py b/tests/similarity/test_matchms_compatibility.py index 947fbe3..4a40ca2 100644 --- a/tests/similarity/test_matchms_compatibility.py +++ b/tests/similarity/test_matchms_compatibility.py @@ -6,8 +6,11 @@ BaseSimilarity, CosineGreedy, FingerprintSimilarity, - ModifiedCosine, ) +try: + from matchms.similarity import ModifiedCosine +except ImportError: # matchms >= 0.34 renamed it + from matchms.similarity import ModifiedCosineGreedy as ModifiedCosine from simms.similarity import ( CudaCosineGreedy, CudaFingerprintSimilarity, diff --git a/tests/stress/test_stress.py b/tests/stress/test_stress.py index ca45dbb..35a3c9e 100644 --- a/tests/stress/test_stress.py +++ b/tests/stress/test_stress.py @@ -2,7 +2,11 @@ import numpy as np import pytest from matchms.filtering import reduce_to_number_of_peaks -from matchms.similarity import CosineGreedy, ModifiedCosine +from matchms.similarity import CosineGreedy +try: + from matchms.similarity import ModifiedCosine +except ImportError: # matchms >= 0.34 renamed it + from matchms.similarity import ModifiedCosineGreedy as ModifiedCosine from matchms.similarity.BaseSimilarity import BaseSimilarity from sparsestack import StackedSparseArray from simms.similarity import CudaCosineGreedy, CudaModifiedCosine From f24faa958443e23c63ad8f24aea9c437ab8e086e Mon Sep 17 00:00:00 2001 From: Jeroen Van Goey Date: Wed, 18 Nov 2026 09:16:52 +0200 Subject: [PATCH 2/4] chore: support Python 3.11-3.14, dropping end-of-life 3.10 --- .github/workflows/python-package.yml | 2 +- README.md | 2 +- pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 22ce9cc..4357766 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index b8f646e..7b21135 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ The **easiest way** to get started is to use the =0.24", "numba>=0.61", @@ -27,10 +27,10 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] keywords = [ "similarity measures", From 361993e411e38b9f737208ba46f103d5db8011ad Mon Sep 17 00:00:00 2001 From: Jeroen Van Goey Date: Wed, 18 Nov 2026 16:46:09 +0200 Subject: [PATCH 3/4] fix: require torch >= 2.4, so the cu12 extra doesn't resolve to a CUDA 11 PyTorch; say the extra must match torch's CUDA --- README.md | 8 +++++--- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7b21135..6d64eac 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ pip install "simms[cu12] @ git+https://github.com/PangeAI/simms" The `cu12` / `cu13` extra installs the CUDA compiler pieces Numba needs (NVVM, libdevice) from pip, through [numba-cuda](https://github.com/NVIDIA/numba-cuda). Without an extra, Numba uses a CUDA toolkit installed on the system. +The extra has to match the CUDA major version of your PyTorch build, which `python -c "import torch; print(torch.version.cuda)"` prints. Recent PyTorch wheels on PyPI are built for CUDA 13, so in a fresh environment `cu12` resolves to the newest PyTorch built for CUDA 12, and `cu13` to the newest PyTorch. If PyTorch is already installed, pick the extra that matches it, or pip may replace it. + ## Use with MatchMS ```py @@ -112,11 +114,11 @@ For local installations, we recommend using [`micromamba`](https://mamba.readthe SimMS needs Python 3.11–3.14. Total size of install will be around 7-8GB (heaviest packages are `pytorch` and the CUDA libraries). ```bash -# Install torch (follow the official guide https://pytorch.org/get-started/locally/#start-locally) +# Install torch for your CUDA version (follow the official guide https://pytorch.org/get-started/locally/#start-locally) pip install torch -# Install this repository, with the CUDA pieces for Numba from pip (cu12 or cu13, matching your driver) -pip install "simms[cu12] @ git+https://github.com/PangeAI/simms" +# Install this repository, with the CUDA pieces for Numba from pip: the extra matching torch.version.cuda (cu12 or cu13) +pip install "simms[cu13] @ git+https://github.com/PangeAI/simms" ``` With conda, install `cuda-toolkit` and `numba-cuda` from conda-forge instead of using the extra. diff --git a/pyproject.toml b/pyproject.toml index c09536c..7512a1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [ "numba-cuda>=0.30", "numpy>=1.24", "sparsestack>=0.5", - "torch>=2.0.0", + "torch>=2.4", "tqdm>=4.66.4", "joblib>=1.4.0", "requests>=2.31.0", From 3031b952b147bd4cc305848f588add981427f701 Mon Sep 17 00:00:00 2001 From: Jeroen Van Goey Date: Wed, 18 Nov 2026 17:13:56 +0200 Subject: [PATCH 4/4] fix: cap cuda-core below 1.3 for cu12 (PyTorch 2.10 pins cuda-bindings 12.9.4), require PyTorch 2.11+ for cu13 --- README.md | 2 +- pyproject.toml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6d64eac..601b2e1 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ pip install "simms[cu12] @ git+https://github.com/PangeAI/simms" The `cu12` / `cu13` extra installs the CUDA compiler pieces Numba needs (NVVM, libdevice) from pip, through [numba-cuda](https://github.com/NVIDIA/numba-cuda). Without an extra, Numba uses a CUDA toolkit installed on the system. -The extra has to match the CUDA major version of your PyTorch build, which `python -c "import torch; print(torch.version.cuda)"` prints. Recent PyTorch wheels on PyPI are built for CUDA 13, so in a fresh environment `cu12` resolves to the newest PyTorch built for CUDA 12, and `cu13` to the newest PyTorch. If PyTorch is already installed, pick the extra that matches it, or pip may replace it. +The extra has to match the CUDA major version of your PyTorch build, which `python -c "import torch; print(torch.version.cuda)"` prints. PyTorch wheels on PyPI are built for CUDA 12 up to 2.10 and for CUDA 13 from 2.11, so in a fresh environment `cu12` resolves to PyTorch 2.10 and `cu13` to the newest PyTorch. If PyTorch is already installed, pick the extra that matches it, or pip may replace it. ## Use with MatchMS diff --git a/pyproject.toml b/pyproject.toml index 7512a1e..b29930c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,8 +42,11 @@ keywords = [ [project.optional-dependencies] # NVVM, libdevice and the CUDA runtime from pip wheels, instead of a system or conda CUDA toolkit. -cu12 = ["numba-cuda[cu12]>=0.30"] -cu13 = ["numba-cuda[cu13]>=0.30"] +# cu12: cuda-core 1.3 refuses cuda-bindings < 12.9.8 at import, but PyTorch 2.10 (the last PyPI PyTorch built for +# CUDA 12) pins cuda-bindings 12.9.4; numba-cuda doesn't cap cuda-core, so cap it here until that clash is resolved. +cu12 = ["numba-cuda[cu12]>=0.30", "cuda-core<1.3"] +# cu13: PyPI PyTorch is built for CUDA 13 from 2.11 on; without the floor, pip can settle on an older, CUDA 12 PyTorch. +cu13 = ["numba-cuda[cu13]>=0.30", "torch>=2.11"] [project.urls] homepage = "https://github.com/PangeAI/simms"