style(infra): use modern Optional typing in script (#33361)

This commit is contained in:
Mason Daugherty authored and GitHub committed 2025-10-08 21:09:43 -04:00
1 parent d13823043d
commit ffb1a08871
1 file changed
+2 -3
+2 -3
View File
@@ -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: