RUN_THIS.py 929 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. # Import future so people on py2 still get the clear error that they need to upgrade.
  3. from __future__ import print_function
  4. import sys
  5. import subprocess
  6. import importlib.util
  7. version = sys.version_info
  8. if version.major < 3 or (version.major == 3 and version.minor < 5):
  9. print("ERROR: You need at least Python 3.5 to build SS14.")
  10. sys.exit(1)
  11. # These libraries are used into mapGeneration.py
  12. required_libraries = ['numpy', 'pyyaml', 'pyfastnoiselite']
  13. # Checks if we have all libs needed
  14. def is_library_installed(library):
  15. return importlib.util.find_spec(library) is not None
  16. # Install needed libs that are missing
  17. for library in required_libraries:
  18. if not is_library_installed(library):
  19. print(f"Installing lib {library}...")
  20. subprocess.check_call([sys.executable, "-m", "pip", "install", library])
  21. subprocess.run([sys.executable, "git_helper.py"], cwd="BuildChecker")