From 2398624c2e3e764c8e3e282062db49ad4479a5ad Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 23 Aug 2024 08:06:37 -0500 Subject: [PATCH] Drop Python 3.9 support (#6040) Contributes to https://github.com/rapidsai/build-planning/issues/88 Finishes the work of dropping Python 3.9 support. This project stopped building / testing against Python 3.9 as of https://github.com/rapidsai/shared-workflows/pull/235. This PR updates configuration and docs to reflect that. ## Notes for Reviewers ### How I tested this Checked that there were no remaining uses like this: ```shell git grep -E '3\.9' git grep '39' git grep 'py39' ``` And similar for variations on Python 3.8 (to catch things that were missed the last time this was done). Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuml/pull/6040 --- 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/cuml/internals/available_devices.py | 8 ++------ python/cuml/pyproject.toml | 5 ++--- 5 files changed, 7 insertions(+), 16 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 8c2508ce6b..1c8afd0a81 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -462,10 +462,6 @@ dependencies: specific: - output_types: conda matrices: - - matrix: - py: "3.9" - packages: - - python=3.9 - matrix: py: "3.10" packages: @@ -476,7 +472,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/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(): diff --git a/python/cuml/pyproject.toml b/python/cuml/pyproject.toml index ad8d16e076..357f427bff 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 |