From ffb1a08871c614fe2b6b9ccece126e0989fc1a40 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Wed, 8 Oct 2025 21:09:43 -0400 Subject: [PATCH] style(infra): use modern `Optional` typing in script (#33361) --- .github/scripts/get_min_versions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/scripts/get_min_versions.py b/.github/scripts/get_min_versions.py index c5c5ecc570..5669172866 100644 --- a/.github/scripts/get_min_versions.py +++ b/.github/scripts/get_min_versions.py @@ -2,7 +2,6 @@ import sys from collections import defaultdict -from typing import Optional if sys.version_info >= (3, 11): import tomllib @@ -54,7 +53,7 @@ def get_pypi_versions(package_name: str) -> List[str]: return list(response.json()["releases"].keys()) -def get_minimum_version(package_name: str, spec_string: str) -> Optional[str]: +def get_minimum_version(package_name: str, spec_string: str) -> str | None: """Find the minimum published version that satisfies the given constraints. Args: @@ -114,7 +113,7 @@ def get_min_version_from_toml( versions_for: str, python_version: str, *, - include: Optional[list] = None, + include: list | None = None, ): # Parse the TOML file with open(toml_path, "rb") as file: