You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ar...@apache.org on 2026/06/26 16:53:14 UTC

(tooling-trusted-releases) 01/03: #478 - fix classifier for packaged artifacts

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

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

commit 81d3f562fe27072a38f1d95bc01ef12935931b44
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Fri Jun 26 15:04:17 2026 +0100

    #478 - fix classifier for packaged artifacts
---
 atr/classify.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/atr/classify.py b/atr/classify.py
index 93775996..f15a9392 100644
--- a/atr/classify.py
+++ b/atr/classify.py
@@ -112,6 +112,10 @@ _TOKEN_SPLIT_RE: Final[re.Pattern[str]] = re.compile(r"[-_.]+")
 
 _DEFAULT_BINARY_EXTENSIONS: Final[frozenset[str]] = frozenset({".jar", ".whl"})
 
+# Platform packages are binary distributions even when they carry source (a src.rpm),
+# so they never identify a release on their own
+_PACKAGE_BINARY_EXTENSIONS: Final[frozenset[str]] = frozenset({".rpm", ".deb", ".msi", ".dmg", ".exe", ".apk"})
+
 
 class FileType(enum.Enum):
     BINARY = "binary"
@@ -201,6 +205,8 @@ async def classify(
 
 
 def classify_from_counts(path_str: str, source_count: int, binary_count: int, docs_count: int) -> FileType:
+    if any(path_str.endswith(suffix) for suffix in _PACKAGE_BINARY_EXTENSIONS):
+        return FileType.BINARY
     if (source_count == 0) and (binary_count == 0):
         if docs_count > 0:
             return FileType.DOCS


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org