Split requirements into world types, automatically discover and resolve them.

This commit is contained in:
Fabian Dill
2021-06-06 15:30:20 +02:00
parent cae1188ff8
commit c095c28618
5 changed files with 15 additions and 6 deletions

View File

@@ -3,12 +3,20 @@ import sys
import subprocess
import pkg_resources
requirements_files = ['requirements.txt']
requirements_files = {'requirements.txt'}
if sys.version_info < (3, 8, 6):
raise RuntimeError("Incompatible Python Version. 3.8.7+ is supported.")
update_ran = getattr(sys, "frozen", False) # don't run update if environment is frozen/compiled
if not update_ran:
for entry in os.scandir("worlds"):
if entry.is_dir():
req_file = os.path.join(entry.path, "requirements.txt")
if os.path.exists(req_file):
requirements_files.add(req_file)
def update_command():
for file in requirements_files: