This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new b59dc91  Use a more precise type for deletable choices
b59dc91 is described below

commit b59dc91354a35b1ca43bbada2af8777cdb297ae1
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Dec 9 15:15:57 2025 +0000

    Use a more precise type for deletable choices
---
 atr/get/finish.py          | 11 +++--------
 atr/models/distribution.py |  2 +-
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/atr/get/finish.py b/atr/get/finish.py
index dfc03ad..63f0940 100644
--- a/atr/get/finish.py
+++ b/atr/get/finish.py
@@ -19,7 +19,6 @@
 import dataclasses
 import json
 import pathlib
-from typing import Any
 
 import aiofiles.os
 import asfquart.base as base
@@ -117,13 +116,9 @@ async def _analyse_rc_tags(latest_revision_dir: 
pathlib.Path) -> RCTagAnalysisRe
     return r
 
 
-async def _deletable_choices(latest_revision_dir: pathlib.Path, target_dirs: 
set[pathlib.Path]) -> Any:
-    # This should be -> list[tuple[str, str]], but that causes pyright to 
complain incorrectly
-    # Details in 
pyright/dist/dist/typeshed-fallback/stubs/WTForms/wtforms/fields/choices.pyi
-    # _Choice: TypeAlias = tuple[Any, str] | tuple[Any, str, dict[str, Any]]
-    # Then it wants us to use list[_Choice] (= list[tuple[Any, str]])
-    # But it says, incorrectly, that list[tuple[str, str]] is not a 
list[_Choice]
-    # This mistake is not made by mypy
+async def _deletable_choices(
+    latest_revision_dir: pathlib.Path, target_dirs: set[pathlib.Path]
+) -> list[tuple[str, str]]:
     empty_deletable_dirs: list[pathlib.Path] = []
     if latest_revision_dir.exists():
         for d_rel in target_dirs:
diff --git a/atr/models/distribution.py b/atr/models/distribution.py
index 9edf4b3..2e199c8 100644
--- a/atr/models/distribution.py
+++ b/atr/models/distribution.py
@@ -88,7 +88,7 @@ class PyPIResponse(schema.Lax):
 
 
 # Lax to ignore csrf_token and submit
-# WTForms types platform as Any, which is insufficient
+# Our previous forms implementation typed platform as Any, which was 
insufficient
 # And this way we also get nice JSON from the Pydantic model dump
 # Including all of the enum properties
 class Data(schema.Lax):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to