From 96c6628b861fc2b037eb139bd465c7e6ae7b139d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 21 Aug 2024 17:43:39 -0500 Subject: [PATCH 1/2] Drop Python 3.9 support --- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-125_arch-x86_64.yaml | 2 +- dependencies.yaml | 6 +----- python/cuml/pyproject.toml | 5 ++--- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index e8a39e250e..73cfd8f1e0 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -57,7 +57,7 @@ dependencies: - pytest-cov - pytest-xdist - pytest==7.* -- python>=3.9,<3.12 +- python>=3.10,<3.12 - raft-dask==24.10.*,>=0.0.0a0 - rapids-build-backend>=0.3.0,<0.4.0.dev0 - rapids-dask-dependency==24.10.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml index 293028cdb1..43bf7117b3 100644 --- a/conda/environments/all_cuda-125_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -53,7 +53,7 @@ dependencies: - pytest-cov - pytest-xdist - pytest==7.* -- python>=3.9,<3.12 +- python>=3.10,<3.12 - raft-dask==24.10.*,>=0.0.0a0 - rapids-build-backend>=0.3.0,<0.4.0.dev0 - rapids-dask-dependency==24.10.*,>=0.0.0a0 diff --git a/dependencies.yaml b/dependencies.yaml index e22aec7034..a9edc41364 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -450,10 +450,6 @@ dependencies: specific: - output_types: conda matrices: - - matrix: - py: "3.9" - packages: - - python=3.9 - matrix: py: "3.10" packages: @@ -464,7 +460,7 @@ dependencies: - python=3.11 - matrix: packages: - - python>=3.9,<3.12 + - python>=3.10,<3.12 test_libcuml: common: - output_types: conda diff --git a/python/cuml/pyproject.toml b/python/cuml/pyproject.toml index 0b5c650703..96215c140a 100644 --- a/python/cuml/pyproject.toml +++ b/python/cuml/pyproject.toml @@ -78,7 +78,7 @@ authors = [ { name = "NVIDIA Corporation" }, ] license = { text = "Apache 2.0" } -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ "cudf==24.10.*,>=0.0.0a0", "cupy-cuda11x>=12.0.0", @@ -102,7 +102,6 @@ dependencies = [ classifiers = [ "Intended Audience :: Developers", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] @@ -134,7 +133,7 @@ Documentation = "https://docs.rapids.ai/api/cuml/stable/" [tool.black] line-length = 79 -target-version = ["py39"] +target-version = ["py310"] include = '\.py?$' force-exclude = ''' _stop_words\.py | From 11de09e55887150cec1d2fce4f48ca6f0761efe8 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 21 Aug 2024 18:07:56 -0500 Subject: [PATCH 2/2] use functools.cache unconditionally --- python/cuml/cuml/internals/available_devices.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/python/cuml/cuml/internals/available_devices.py b/python/cuml/cuml/internals/available_devices.py index 8110f1b5d1..ee3b9b2500 100644 --- a/python/cuml/cuml/internals/available_devices.py +++ b/python/cuml/cuml/internals/available_devices.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,12 +16,8 @@ from cuml.internals.device_support import GPU_ENABLED from cuml.internals.safe_imports import gpu_only_import_from, UnavailableError -try: - from functools import cache # requires Python >= 3.9 -except ImportError: - from functools import lru_cache - cache = lru_cache(maxsize=None) +from functools import cache def gpu_available_no_context_creation():