From 736df5741b44f33c8d8e410ec49705691f464dff Mon Sep 17 00:00:00 2001
From: James Lamb <jlamb@nvidia.com>
Date: Tue, 12 Nov 2024 23:50:30 -0600
Subject: [PATCH 1/5] enforce wheel size limits, README formatting in CI

---
 ci/build_wheel_pylibraft.sh     |  5 ++++-
 ci/build_wheel_raft_dask.sh     |  5 ++++-
 ci/validate_wheel.sh            | 18 ++++++++++++++++++
 python/pylibraft/pyproject.toml |  8 ++++++++
 python/raft-dask/pyproject.toml |  8 ++++++++
 5 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100755 ci/validate_wheel.sh

diff --git a/ci/build_wheel_pylibraft.sh b/ci/build_wheel_pylibraft.sh
index ce9f0ed172..dacaa1190e 100755
--- a/ci/build_wheel_pylibraft.sh
+++ b/ci/build_wheel_pylibraft.sh
@@ -3,6 +3,8 @@
 
 set -euo pipefail
 
+package_dir="python/pylibraft"
+
 case "${RAPIDS_CUDA_VERSION}" in
   12.*)
     EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=ON"
@@ -15,4 +17,5 @@ esac
 # Set up skbuild options. Enable sccache in skbuild config options
 export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_RAFT_CPP=OFF${EXTRA_CMAKE_ARGS}"
 
-ci/build_wheel.sh pylibraft python/pylibraft
+ci/build_wheel.sh pylibraft ${package_dir}
+ci/validate_wheel.sh ${package_dir} final_dist
diff --git a/ci/build_wheel_raft_dask.sh b/ci/build_wheel_raft_dask.sh
index feba2d7a5b..e4f3f0a833 100755
--- a/ci/build_wheel_raft_dask.sh
+++ b/ci/build_wheel_raft_dask.sh
@@ -3,7 +3,10 @@
 
 set -euo pipefail
 
+package_dir="python/raft-dask"
+
 # Set up skbuild options. Enable sccache in skbuild config options
 export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_RAFT_CPP=OFF"
 
-ci/build_wheel.sh raft-dask python/raft-dask
+ci/build_wheel.sh raft-dask ${package_dir}
+ci/validate_wheel.sh ${package_dir} final_dist
diff --git a/ci/validate_wheel.sh b/ci/validate_wheel.sh
new file mode 100755
index 0000000000..60a80fce6b
--- /dev/null
+++ b/ci/validate_wheel.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Copyright (c) 2024, NVIDIA CORPORATION.
+
+set -euo pipefail
+
+wheel_dir_relative_path=$1
+
+rapids-logger "validate packages with 'pydistcheck'"
+
+pydistcheck \
+    --inspect \
+    "$(echo ${wheel_dir_relative_path}/*.whl)"
+
+rapids-logger "validate packages with 'twine'"
+
+twine check \
+    --strict \
+    "$(echo ${wheel_dir_relative_path}/*.whl)"
diff --git a/python/pylibraft/pyproject.toml b/python/pylibraft/pyproject.toml
index 599b3dd54e..839f0a40d2 100644
--- a/python/pylibraft/pyproject.toml
+++ b/python/pylibraft/pyproject.toml
@@ -130,6 +130,14 @@ requires = [
 dependencies-file = "../../dependencies.yaml"
 matrix-entry = "cuda_suffixed=true;use_cuda_wheels=true"
 
+[tool.pydistcheck]
+select = [
+    "distro-too-large-compressed",
+]
+
+# detect when package size grows significantly
+max_allowed_size_compressed = '550M'
+
 [tool.pytest.ini_options]
 filterwarnings = [
     "error",
diff --git a/python/raft-dask/pyproject.toml b/python/raft-dask/pyproject.toml
index d71f89085b..4c5df90601 100644
--- a/python/raft-dask/pyproject.toml
+++ b/python/raft-dask/pyproject.toml
@@ -126,3 +126,11 @@ requires = [
 ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
 dependencies-file = "../../dependencies.yaml"
 matrix-entry = "cuda_suffixed=true"
+
+[tool.pydistcheck]
+select = [
+    "distro-too-large-compressed",
+]
+
+# detect when package size grows significantly
+max_allowed_size_compressed = '300M'

From 28cf9e4d3088b4c3bb3d7412bea1ffcf004010d8 Mon Sep 17 00:00:00 2001
From: James Lamb <jlamb@nvidia.com>
Date: Wed, 13 Nov 2024 00:11:10 -0600
Subject: [PATCH 2/5] use form that takes package_dir

---
 ci/validate_wheel.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ci/validate_wheel.sh b/ci/validate_wheel.sh
index 60a80fce6b..5910a5c59f 100755
--- a/ci/validate_wheel.sh
+++ b/ci/validate_wheel.sh
@@ -3,7 +3,10 @@
 
 set -euo pipefail
 
-wheel_dir_relative_path=$1
+package_dir=$1
+wheel_dir_relative_path=$2
+
+cd "${package_dir}"
 
 rapids-logger "validate packages with 'pydistcheck'"
 

From c5a15f8a75356f0510f42be17d8b07e4f321a4fc Mon Sep 17 00:00:00 2001
From: James Lamb <jlamb@nvidia.com>
Date: Wed, 13 Nov 2024 00:26:04 -0600
Subject: [PATCH 3/5] aarch64 pylibraft wheels are over 700MB compressed

---
 python/pylibraft/pyproject.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pylibraft/pyproject.toml b/python/pylibraft/pyproject.toml
index 839f0a40d2..75707e1a0f 100644
--- a/python/pylibraft/pyproject.toml
+++ b/python/pylibraft/pyproject.toml
@@ -136,7 +136,7 @@ select = [
 ]
 
 # detect when package size grows significantly
-max_allowed_size_compressed = '550M'
+max_allowed_size_compressed = '825M'
 
 [tool.pytest.ini_options]
 filterwarnings = [

From eeb43a2427ffb0eebb626e63016a7b7f895b91a6 Mon Sep 17 00:00:00 2001
From: James Lamb <jlamb@nvidia.com>
Date: Wed, 13 Nov 2024 12:34:35 -0600
Subject: [PATCH 4/5] put a ceiling on Cython

---
 conda/environments/all_cuda-118_arch-aarch64.yaml       | 2 +-
 conda/environments/all_cuda-118_arch-x86_64.yaml        | 2 +-
 conda/environments/all_cuda-125_arch-aarch64.yaml       | 2 +-
 conda/environments/all_cuda-125_arch-x86_64.yaml        | 2 +-
 conda/environments/bench_ann_cuda-118_arch-aarch64.yaml | 2 +-
 conda/environments/bench_ann_cuda-118_arch-x86_64.yaml  | 2 +-
 conda/environments/bench_ann_cuda-120_arch-aarch64.yaml | 2 +-
 conda/environments/bench_ann_cuda-120_arch-x86_64.yaml  | 2 +-
 conda/recipes/pylibraft/meta.yaml                       | 2 +-
 conda/recipes/raft-dask/meta.yaml                       | 2 +-
 dependencies.yaml                                       | 2 +-
 python/pylibraft/pyproject.toml                         | 2 +-
 python/raft-dask/pyproject.toml                         | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/conda/environments/all_cuda-118_arch-aarch64.yaml b/conda/environments/all_cuda-118_arch-aarch64.yaml
index a21f30dd94..72c45be96e 100644
--- a/conda/environments/all_cuda-118_arch-aarch64.yaml
+++ b/conda/environments/all_cuda-118_arch-aarch64.yaml
@@ -19,7 +19,7 @@ dependencies:
 - cudatoolkit
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml
index 3eb7cdea67..feefccb721 100644
--- a/conda/environments/all_cuda-118_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-118_arch-x86_64.yaml
@@ -19,7 +19,7 @@ dependencies:
 - cudatoolkit
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/all_cuda-125_arch-aarch64.yaml b/conda/environments/all_cuda-125_arch-aarch64.yaml
index c13b4a4bfa..da240f40c7 100644
--- a/conda/environments/all_cuda-125_arch-aarch64.yaml
+++ b/conda/environments/all_cuda-125_arch-aarch64.yaml
@@ -20,7 +20,7 @@ dependencies:
 - cuda-version=12.5
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml
index 5820017b5d..260d361ca3 100644
--- a/conda/environments/all_cuda-125_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-125_arch-x86_64.yaml
@@ -20,7 +20,7 @@ dependencies:
 - cuda-version=12.5
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
index 4c9d308ecd..f8818c5c7a 100644
--- a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
+++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
@@ -17,7 +17,7 @@ dependencies:
 - cuda-version=11.8
 - cudatoolkit
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - gcc_linux-aarch64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
index 1b62c492cf..8e28099b9c 100644
--- a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
+++ b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
@@ -17,7 +17,7 @@ dependencies:
 - cuda-version=11.8
 - cudatoolkit
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - gcc_linux-64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
index 54d67f462a..fa57cb1f39 100644
--- a/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
+++ b/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
@@ -18,7 +18,7 @@ dependencies:
 - cuda-profiler-api
 - cuda-version=12.0
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - gcc_linux-aarch64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
index 4f39378047..3c9995e67f 100644
--- a/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
+++ b/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
@@ -18,7 +18,7 @@ dependencies:
 - cuda-profiler-api
 - cuda-version=12.0
 - cxx-compiler
-- cython>=3.0.0
+- cython>=3.0.0,<=3.1.0a0
 - gcc_linux-64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/recipes/pylibraft/meta.yaml b/conda/recipes/pylibraft/meta.yaml
index ceed46a2d7..dafedcb432 100644
--- a/conda/recipes/pylibraft/meta.yaml
+++ b/conda/recipes/pylibraft/meta.yaml
@@ -50,7 +50,7 @@ requirements:
     - cuda-cudart-dev
     {% endif %}
     - cuda-version ={{ cuda_version }}
-    - cython >=3.0.0
+    - cython >=3.0.0,<=3.1.0a0
     - libraft {{ version }}
     - libraft-headers {{ version }}
     - python x.x
diff --git a/conda/recipes/raft-dask/meta.yaml b/conda/recipes/raft-dask/meta.yaml
index b2e468f7ea..7687eee9a9 100644
--- a/conda/recipes/raft-dask/meta.yaml
+++ b/conda/recipes/raft-dask/meta.yaml
@@ -50,7 +50,7 @@ requirements:
     - cuda-cudart-dev
     {% endif %}
     - cuda-version ={{ cuda_version }}
-    - cython >=3.0.0
+    - cython >=3.0.0,<=3.1.0a0
     - nccl {{ nccl_version }}
     - pylibraft {{ version }}
     - python x.x
diff --git a/dependencies.yaml b/dependencies.yaml
index f31464aa91..4260e37d2f 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -164,7 +164,7 @@ dependencies:
       - output_types: [conda, requirements, pyproject]
         packages:
           - &cmake_ver cmake>=3.26.4,!=3.30.0
-          - cython>=3.0.0
+          - cython>=3.0.0,<=3.1.0a0
           - ninja
       - output_types: [conda]
         packages:
diff --git a/python/pylibraft/pyproject.toml b/python/pylibraft/pyproject.toml
index 75707e1a0f..3d095f9a99 100644
--- a/python/pylibraft/pyproject.toml
+++ b/python/pylibraft/pyproject.toml
@@ -123,7 +123,7 @@ build-backend = "scikit_build_core.build"
 requires = [
     "cmake>=3.26.4,!=3.30.0",
     "cuda-python",
-    "cython>=3.0.0",
+    "cython>=3.0.0,<=3.1.0a0",
     "ninja",
     "rmm==24.12.*,>=0.0.0a0",
 ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
diff --git a/python/raft-dask/pyproject.toml b/python/raft-dask/pyproject.toml
index 4c5df90601..2ecaff4abc 100644
--- a/python/raft-dask/pyproject.toml
+++ b/python/raft-dask/pyproject.toml
@@ -120,7 +120,7 @@ regex = "(?P<value>.*)"
 build-backend = "scikit_build_core.build"
 requires = [
     "cmake>=3.26.4,!=3.30.0",
-    "cython>=3.0.0",
+    "cython>=3.0.0,<=3.1.0a0",
     "libucx==1.15.0",
     "ninja",
 ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

From 42064859d662c67bf342f6b79633e63a52c66ce2 Mon Sep 17 00:00:00 2001
From: James Lamb <jlamb@nvidia.com>
Date: Wed, 13 Nov 2024 18:22:59 -0600
Subject: [PATCH 5/5] make Cython ceiling stricter

---
 conda/environments/all_cuda-118_arch-aarch64.yaml       | 2 +-
 conda/environments/all_cuda-118_arch-x86_64.yaml        | 2 +-
 conda/environments/all_cuda-125_arch-aarch64.yaml       | 2 +-
 conda/environments/all_cuda-125_arch-x86_64.yaml        | 2 +-
 conda/environments/bench_ann_cuda-118_arch-aarch64.yaml | 2 +-
 conda/environments/bench_ann_cuda-118_arch-x86_64.yaml  | 2 +-
 conda/environments/bench_ann_cuda-120_arch-aarch64.yaml | 2 +-
 conda/environments/bench_ann_cuda-120_arch-x86_64.yaml  | 2 +-
 conda/recipes/pylibraft/meta.yaml                       | 2 +-
 conda/recipes/raft-dask/meta.yaml                       | 2 +-
 dependencies.yaml                                       | 2 +-
 python/pylibraft/pyproject.toml                         | 2 +-
 python/raft-dask/pyproject.toml                         | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/conda/environments/all_cuda-118_arch-aarch64.yaml b/conda/environments/all_cuda-118_arch-aarch64.yaml
index 72c45be96e..6098cd12bf 100644
--- a/conda/environments/all_cuda-118_arch-aarch64.yaml
+++ b/conda/environments/all_cuda-118_arch-aarch64.yaml
@@ -19,7 +19,7 @@ dependencies:
 - cudatoolkit
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml
index feefccb721..0fe8fbab39 100644
--- a/conda/environments/all_cuda-118_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-118_arch-x86_64.yaml
@@ -19,7 +19,7 @@ dependencies:
 - cudatoolkit
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/all_cuda-125_arch-aarch64.yaml b/conda/environments/all_cuda-125_arch-aarch64.yaml
index da240f40c7..dfb9ac0b97 100644
--- a/conda/environments/all_cuda-125_arch-aarch64.yaml
+++ b/conda/environments/all_cuda-125_arch-aarch64.yaml
@@ -20,7 +20,7 @@ dependencies:
 - cuda-version=12.5
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml
index 260d361ca3..bf6f5d6462 100644
--- a/conda/environments/all_cuda-125_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-125_arch-x86_64.yaml
@@ -20,7 +20,7 @@ dependencies:
 - cuda-version=12.5
 - cupy>=12.0.0
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - dask-cuda==24.12.*,>=0.0.0a0
 - distributed-ucxx==0.41.*,>=0.0.0a0
 - doxygen>=1.8.20
diff --git a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
index f8818c5c7a..39bdf2671d 100644
--- a/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
+++ b/conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
@@ -17,7 +17,7 @@ dependencies:
 - cuda-version=11.8
 - cudatoolkit
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - gcc_linux-aarch64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
index 8e28099b9c..56004fa818 100644
--- a/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
+++ b/conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
@@ -17,7 +17,7 @@ dependencies:
 - cuda-version=11.8
 - cudatoolkit
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - gcc_linux-64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
index fa57cb1f39..5f0599d9ae 100644
--- a/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
+++ b/conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
@@ -18,7 +18,7 @@ dependencies:
 - cuda-profiler-api
 - cuda-version=12.0
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - gcc_linux-aarch64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
index 3c9995e67f..849e6c1412 100644
--- a/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
+++ b/conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
@@ -18,7 +18,7 @@ dependencies:
 - cuda-profiler-api
 - cuda-version=12.0
 - cxx-compiler
-- cython>=3.0.0,<=3.1.0a0
+- cython>=3.0.0,<3.1.0a0
 - gcc_linux-64=11.*
 - glog>=0.6.0
 - h5py>=3.8.0
diff --git a/conda/recipes/pylibraft/meta.yaml b/conda/recipes/pylibraft/meta.yaml
index dafedcb432..01a9d61f0f 100644
--- a/conda/recipes/pylibraft/meta.yaml
+++ b/conda/recipes/pylibraft/meta.yaml
@@ -50,7 +50,7 @@ requirements:
     - cuda-cudart-dev
     {% endif %}
     - cuda-version ={{ cuda_version }}
-    - cython >=3.0.0,<=3.1.0a0
+    - cython >=3.0.0,<3.1.0a0
     - libraft {{ version }}
     - libraft-headers {{ version }}
     - python x.x
diff --git a/conda/recipes/raft-dask/meta.yaml b/conda/recipes/raft-dask/meta.yaml
index 7687eee9a9..02a8957b06 100644
--- a/conda/recipes/raft-dask/meta.yaml
+++ b/conda/recipes/raft-dask/meta.yaml
@@ -50,7 +50,7 @@ requirements:
     - cuda-cudart-dev
     {% endif %}
     - cuda-version ={{ cuda_version }}
-    - cython >=3.0.0,<=3.1.0a0
+    - cython >=3.0.0,<3.1.0a0
     - nccl {{ nccl_version }}
     - pylibraft {{ version }}
     - python x.x
diff --git a/dependencies.yaml b/dependencies.yaml
index 4260e37d2f..7766481c99 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -164,7 +164,7 @@ dependencies:
       - output_types: [conda, requirements, pyproject]
         packages:
           - &cmake_ver cmake>=3.26.4,!=3.30.0
-          - cython>=3.0.0,<=3.1.0a0
+          - cython>=3.0.0,<3.1.0a0
           - ninja
       - output_types: [conda]
         packages:
diff --git a/python/pylibraft/pyproject.toml b/python/pylibraft/pyproject.toml
index 3d095f9a99..bb01602b33 100644
--- a/python/pylibraft/pyproject.toml
+++ b/python/pylibraft/pyproject.toml
@@ -123,7 +123,7 @@ build-backend = "scikit_build_core.build"
 requires = [
     "cmake>=3.26.4,!=3.30.0",
     "cuda-python",
-    "cython>=3.0.0,<=3.1.0a0",
+    "cython>=3.0.0,<3.1.0a0",
     "ninja",
     "rmm==24.12.*,>=0.0.0a0",
 ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
diff --git a/python/raft-dask/pyproject.toml b/python/raft-dask/pyproject.toml
index 2ecaff4abc..a9f4de5dc3 100644
--- a/python/raft-dask/pyproject.toml
+++ b/python/raft-dask/pyproject.toml
@@ -120,7 +120,7 @@ regex = "(?P<value>.*)"
 build-backend = "scikit_build_core.build"
 requires = [
     "cmake>=3.26.4,!=3.30.0",
-    "cython>=3.0.0,<=3.1.0a0",
+    "cython>=3.0.0,<3.1.0a0",
     "libucx==1.15.0",
     "ninja",
 ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.