From 98e0020e2f88f530513fe11c35efc8b7c72c93c2 Mon Sep 17 00:00:00 2001 From: Jack Nagy Date: Mon, 3 Aug 2026 19:45:09 +0100 Subject: [PATCH] fix(ci): treat sdist VCS-ignore files as optional in distribution check hatchling 1.31.0 ships only .gitignore in the sdist; older releases also bundled .hgignore. check_sdist required an exact member set including .hgignore, so the Validate workflow's package job failed on main once CI resolved the newer hatchling. Require the tracked source set plus the fixed metadata files, and accept .gitignore/.hgignore as optional members either way. --- tools/check_distribution.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/check_distribution.py b/tools/check_distribution.py index c246b92..1e5b01b 100755 --- a/tools/check_distribution.py +++ b/tools/check_distribution.py @@ -81,16 +81,18 @@ def check_sdist(path: Path) -> None: raise DistributionError("sdist must contain one top-level directory") root = roots.pop() relative = {name[len(root) + 1 :] for name in names if name.startswith(f"{root}/")} - expected = _tracked_files() | { - ".gitignore", - ".hgignore", + required = _tracked_files() | { "LICENSE", "PKG-INFO", "README.md", "pyproject.toml", "smartthings_local/_version.py", } - if relative != expected: + # hatchling bundles the VCS ignore files it finds, but which ones ship + # depends on the hatchling version (newer releases drop .hgignore), so + # treat them as optional rather than exact members. + optional = {".gitignore", ".hgignore"} + if not required <= relative <= required | optional: raise DistributionError("sdist contents differ from the intended source set")