From ab0d3dfa8c40a49697d1392c643c252a455c1035 Mon Sep 17 00:00:00 2001 From: afloresep Date: Tue, 24 Mar 2026 17:48:47 +0100 Subject: [PATCH 1/3] Fix merge regressions: restore Python 3.10 support, drop macos-13, bump actions - Restore requires-python >= 3.10 (merge from master reverted to 3.12) - Restore typing_extensions conditional dep and Self import - Drop macos-13 runner (deprecated), keep macos-14 (ARM) + Linux - Bump GitHub Actions to v5/v6 to fix Node.js 20 deprecation warnings - Restore CIBW_BUILD for cp310-cp313 - Restore test matrix with 3.10 + 3.12 --- .github/workflows/publish.yml | 15 +++++++-------- .github/workflows/quality.yml | 4 ++-- .github/workflows/tests.yml | 8 ++++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68b8988..856d29f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,11 +14,11 @@ jobs: name: Build sdist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.12" @@ -27,7 +27,7 @@ jobs: pip install build python -m build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: sdist path: dist/*.tar.gz @@ -38,13 +38,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, macos-14] + os: [ubuntu-latest, macos-14] # ubuntu-latest = Linux x86_64 - # macos-13 = macOS x86_64 (Intel) # macos-14 = macOS arm64 (Apple Silicon) steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive @@ -74,7 +73,7 @@ jobs: CIBW_ARCHS_MACOS: "native" CIBW_ARCHS_LINUX: "x86_64" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: wheels-${{ matrix.os }} path: wheelhouse/*.whl @@ -88,7 +87,7 @@ jobs: id-token: write # trusted publishing (no API token needed) steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: path: dist merge-multiple: true diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 627e489..fd9fdaf 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -19,10 +19,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.12" cache: pip diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8434bfe..b3cc870 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,10 +20,10 @@ jobs: python-version: ["3.10", "3.12"] steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip @@ -45,12 +45,12 @@ jobs: python-version: ["3.10", "3.12"] steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip From f4af7ca3b13f6d14292cb791941e0f8345a820fe Mon Sep 17 00:00:00 2001 From: afloresep Date: Tue, 24 Mar 2026 17:52:44 +0100 Subject: [PATCH 2/3] Add openblas-devel to manylinux wheel build --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 856d29f..9714787 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -58,7 +58,7 @@ jobs: # Linux: install build tools inside the manylinux container CIBW_BEFORE_ALL_LINUX: > - yum install -y cmake3 gcc-c++ make && + yum install -y cmake3 gcc-c++ make openblas-devel && ln -sf /usr/bin/cmake3 /usr/bin/cmake || true # macOS: cmake is pre-installed on GitHub runners From 56fb1cebd7ef4dadb1aeef668e10c012c2a25a88 Mon Sep 17 00:00:00 2001 From: afloresep Date: Tue, 24 Mar 2026 18:16:09 +0100 Subject: [PATCH 3/3] Simplify to Python 3.11+ (usearch has no 3.10 Linux wheels) - requires-python >= 3.11 (Self built-in, no typing_extensions needed) - manylinux_2_28 for Linux wheels (required by usearch) - Build cp311/cp312/cp313 wheels - dnf instead of yum for manylinux_2_28 container --- .github/workflows/publish.yml | 12 +++++++----- .github/workflows/tests.yml | 4 ++-- README.md | 2 +- pyproject.toml | 6 ++---- src/tmap/estimator.py | 8 +------- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9714787..a39ad03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -50,16 +50,18 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.21 env: - # Build for Python 3.10 - 3.13 - CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" + # Build for Python 3.11 - 3.13 + CIBW_BUILD: "cp311-* cp312-* cp313-*" # Skip 32-bit and musl (Alpine) builds CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" - # Linux: install build tools inside the manylinux container + # Use manylinux_2_28 (usearch only ships wheels for this platform) + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" + + # Linux: install build tools inside the container CIBW_BEFORE_ALL_LINUX: > - yum install -y cmake3 gcc-c++ make openblas-devel && - ln -sf /usr/bin/cmake3 /usr/bin/cmake || true + dnf install -y cmake gcc-c++ make openblas-devel || true # macOS: cmake is pre-installed on GitHub runners CIBW_BEFORE_ALL_MACOS: > diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3cc870..2f653aa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.12"] + python-version: ["3.11", "3.12"] steps: - name: Check out repository uses: actions/checkout@v5 @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.12"] + python-version: ["3.11", "3.12"] steps: - name: Check out repository uses: actions/checkout@v5 diff --git a/README.md b/README.md index f9aecd5..513f855 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Tests](https://github.com/afloresep/TMAP/actions/workflows/tests.yml/badge.svg)](https://github.com/afloresep/TMAP/actions/workflows/tests.yml) [![PyPI](https://img.shields.io/pypi/v/tmap2)](https://pypi.org/project/tmap2/) -[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) +[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) # TMAP2 diff --git a/pyproject.toml b/pyproject.toml index 15949b3..795a4f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ version = "0.1.0" description = "Tree-based visualization for high-dimensional data" readme = "README.md" license = {text = "MIT"} -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [ { name = "Alejandro Flores", email = "afloresep01@gmail.com" } ] @@ -20,7 +20,6 @@ classifiers = [ "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -36,7 +35,6 @@ dependencies = [ "matplotlib>=3.7", "pandas>=2.2", "usearch>=2.16,<3", - "typing_extensions>=4.0; python_version < '3.11'", ] [project.optional-dependencies] @@ -75,7 +73,7 @@ sdist.exclude = [ [tool.ruff] line-length = 100 -target-version = "py310" +target-version = "py311" exclude = ["extern/", "*.ipynb"] [tool.ruff.lint] diff --git a/src/tmap/estimator.py b/src/tmap/estimator.py index 5c533f8..d22e75e 100644 --- a/src/tmap/estimator.py +++ b/src/tmap/estimator.py @@ -2,15 +2,9 @@ import math import pickle -import sys import warnings from pathlib import Path -from typing import TYPE_CHECKING, Any - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self +from typing import TYPE_CHECKING, Any, Self import numpy as np from numpy.typing import NDArray