Skip to content

Commit

Permalink
Merge pull request #5 from skidder/skidder/tweak-4
Browse files Browse the repository at this point in the history
tweak4
  • Loading branch information
skidder authored Nov 2, 2024
2 parents 2cf9288 + 4d2091e commit cdbaf91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ jobs:
- name: Verify artifacts match checked-in deps
run: |
python3 ./deps/verify_deps.py verify-artifact \
--artifact deps-linux.tar.gz \
--deps-dir deps/linux
python3 ./deps/verify_deps.py verify \
--deps-dir deps/linux \
--build-info deps/linux/build-info.json
python3 ./deps/verify_deps.py verify-artifact \
--artifact deps-macos.tar.gz \
--deps-dir deps/osx
python3 ./deps/verify_deps.py verify \
--deps-dir deps/osx \
--build-info deps/osx/build-info.json
# This job updates the checked-in deps on main branch
update-deps:
Expand Down
14 changes: 7 additions & 7 deletions deps/verify_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ def verify_deps(deps_dir: Path, build_info: BuildInfo) -> Tuple[bool, List[str]]

def main():
parser = argparse.ArgumentParser(description="Verify Lilliput dependencies")
parser.add_argument("--deps-dir", required=True, type=Path,
help="Directory containing dependencies (e.g., deps/linux or deps/osx)")

# Create subparsers first
subparsers = parser.add_subparsers(dest="command", required=True)

# Generate command
generate_parser = subparsers.add_parser("generate",
help="Generate build info for dependencies")
generate_parser.add_argument("--deps-dir", required=True, type=Path,
help="Directory containing dependencies")
generate_parser.add_argument("--platform", required=True,
choices=["linux", "macos"],
help="Platform identifier")
Expand All @@ -110,12 +111,14 @@ def main():
# Verify command
verify_parser = subparsers.add_parser("verify",
help="Verify deps against build info")
verify_parser.add_argument("--deps-dir", required=True, type=Path,
help="Directory containing dependencies")
verify_parser.add_argument("--build-info", required=True, type=Path,
help="Path to build info JSON file")

args = parser.parse_args()

if not args.deps_dir.exists():
if not os.path.exists(args.deps_dir):
print(f"Error: deps directory not found: {args.deps_dir}", file=sys.stderr)
sys.exit(1)

Expand All @@ -128,12 +131,9 @@ def main():

output_file = args.output or args.deps_dir / "build-info.json"

# Convert BuildInfo to dict for JSON serialization
build_info_dict = build_info._asdict()

try:
with open(output_file, "w") as f:
json.dump(build_info_dict, f, indent=4)
json.dump(build_info._asdict(), f, indent=4)
print(f"Build info generated successfully: {output_file}")
except (IOError, OSError) as e:
print(f"Error writing build info: {e}", file=sys.stderr)
Expand Down

0 comments on commit cdbaf91

Please sign in to comment.