build_all.py 1020 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python3
  2. """Run the full pipeline end-to-end."""
  3. import argparse
  4. import subprocess
  5. import sys
  6. ap = argparse.ArgumentParser()
  7. ap.add_argument("--congress", type=int, default=119)
  8. ap.add_argument("--skip-fetch", action="store_true")
  9. ap.add_argument("--skip-enrich", action="store_true")
  10. args = ap.parse_args()
  11. C = str(args.congress)
  12. steps = []
  13. if not args.skip_fetch:
  14. steps.append(["python3", "fetch.py", "--congress", C])
  15. steps.append(["python3", "parse.py", "--congress", C])
  16. if not args.skip_enrich:
  17. steps.append(["python3", "enrich_roster.py", "--congress", C])
  18. steps.append(["python3", "parse.py", "--congress", C]) # re-parse to merge enriched roster
  19. steps.append(["python3", "-m", "pytest", "tests/", "-q"])
  20. steps.append(["python3", "build_members.py", "--congress", C])
  21. steps.append(["python3", "build_app.py", "--congress", C])
  22. for s in steps:
  23. print("==>", " ".join(s))
  24. r = subprocess.run(s)
  25. if r.returncode != 0:
  26. sys.exit(r.returncode)
  27. print("build_all: done")