Merge pull request #27 from QuiteYellow/fix/sdist-check-hgignore-optional
fix(ci): treat sdist VCS-ignore files as optional in distribution check
This commit is contained in:
1 file changed
+6
-4
@@ -81,16 +81,18 @@ def check_sdist(path: Path) -> None:
|
|||||||
raise DistributionError("sdist must contain one top-level directory")
|
raise DistributionError("sdist must contain one top-level directory")
|
||||||
root = roots.pop()
|
root = roots.pop()
|
||||||
relative = {name[len(root) + 1 :] for name in names if name.startswith(f"{root}/")}
|
relative = {name[len(root) + 1 :] for name in names if name.startswith(f"{root}/")}
|
||||||
expected = _tracked_files() | {
|
required = _tracked_files() | {
|
||||||
".gitignore",
|
|
||||||
".hgignore",
|
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
"PKG-INFO",
|
"PKG-INFO",
|
||||||
"README.md",
|
"README.md",
|
||||||
"pyproject.toml",
|
"pyproject.toml",
|
||||||
"smartthings_local/_version.py",
|
"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")
|
raise DistributionError("sdist contents differ from the intended source set")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user