From 80209c75d877d043328eb7b1072a76e10a014824 Mon Sep 17 00:00:00 2001 From: Priya Sundaram Date: Fri, 28 Aug 2026 22:30:47 +0000 Subject: [PATCH] Use typing.Self and drop the direct typing-extensions dependency requires-python is >=3.14, so typing.Self (added in 3.11) is always available. Importing Self from typing_extensions required a # noqa: UP035 suppression of ruff's deprecated-import rule and made typing-extensions a direct dependency for a single symbol. - machine_learning/automatic_differentiation.py: import Self from typing - pyproject.toml: remove typing-extensions from project dependencies - uv.lock: drop the root direct edge (typing-extensions stays resolved transitively via beautifulsoup4/anyio, so the package set is unchanged) --- machine_learning/automatic_differentiation.py | 3 +-- pyproject.toml | 1 - uv.lock | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/machine_learning/automatic_differentiation.py b/machine_learning/automatic_differentiation.py index 5c2708247c21..93e77e761ef9 100644 --- a/machine_learning/automatic_differentiation.py +++ b/machine_learning/automatic_differentiation.py @@ -12,10 +12,9 @@ from collections import defaultdict from enum import Enum from types import TracebackType -from typing import Any +from typing import Any, Self import numpy as np -from typing_extensions import Self # noqa: UP035 class OpType(Enum): diff --git a/pyproject.toml b/pyproject.toml index 1a55feda3cbb..c7ce0894fcb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,6 @@ dependencies = [ "statsmodels>=0.14.4", "sympy>=1.13.3", "tweepy>=4.14", - "typing-extensions>=4.12.2", "xgboost>=2.1.3", ] diff --git a/uv.lock b/uv.lock index c75a1070745b..23b55fdb8d88 100644 --- a/uv.lock +++ b/uv.lock @@ -1155,7 +1155,6 @@ dependencies = [ { name = "statsmodels" }, { name = "sympy" }, { name = "tweepy" }, - { name = "typing-extensions" }, { name = "xgboost" }, ] @@ -1193,7 +1192,6 @@ requires-dist = [ { name = "statsmodels", specifier = ">=0.14.4" }, { name = "sympy", specifier = ">=1.13.3" }, { name = "tweepy", specifier = ">=4.14" }, - { name = "typing-extensions", specifier = ">=4.12.2" }, { name = "xgboost", specifier = ">=2.1.3" }, ]