Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Add check to ensure locked dependencies have source distributions available. #14742

Merged
merged 10 commits into from
Feb 13, 2023
Prev Previous commit
Only bother with Poetry 1.3+ lockfiles
  • Loading branch information
reivilibre committed Feb 13, 2023
commit 2e75a313b38179e0a5d820546698f63ad513e911
15 changes: 5 additions & 10 deletions scripts-dev/check_locked_deps_have_sdists.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ def main() -> None:
with open(lockfile_path, "rb") as lockfile:
lockfile_content = tomli.load(lockfile)

packages_to_assets: Dict[str, List[Dict[str, str]]]
# There seem to be two different formats for storing the list of files per package.
if lockfile_content.get("metadata", {}).get("files") is not None:
# either [metadata.files]
packages_to_assets = lockfile_content["metadata"]["files"]
else:
# or a `files` inline table in each [[package]]
packages_to_assets = {
package["name"]: package["files"] for package in lockfile_content["package"]
}
# Poetry 1.3+ lockfile format:
# There's a `files` inline table in each [[package]]
packages_to_assets: Dict[str, List[Dict[str, str]]] = {
package["name"]: package["files"] for package in lockfile_content["package"]
}

success = True

Expand Down