extract_from_setup.py 401 B

123456789101112131415
  1. import sys
  2. def extract_gui_version(base_path: str) -> None:
  3. with open("setup.py") as f:
  4. for line in f:
  5. if "taipy-gui" in line:
  6. start = line.find("taipy-gui")
  7. end = line.rstrip().find('",')
  8. print(f"VERSION={line[start:end]}") # noqa: T201
  9. break
  10. if __name__ == "__main__":
  11. extract_gui_version(sys.argv[1])