Skip to content

Commit

Permalink
Setup: add setup specific requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Jan 22, 2022
1 parent 66c15c8 commit c7e87bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions FactorioClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ async def main(args):
if sys.stdin:
input_task = asyncio.create_task(console_loop(ctx), name="Input")
factorio_server_task = asyncio.create_task(factorio_spinup_server(ctx), name="FactorioSpinupServer")
succesful_launch = await factorio_server_task
if succesful_launch:
successful_launch = await factorio_server_task
if successful_launch:
factorio_server_task = asyncio.create_task(factorio_server_watcher(ctx), name="FactorioServer")
progression_watcher = asyncio.create_task(
game_watcher(ctx), name="FactorioProgressionWatcher")
Expand Down
6 changes: 3 additions & 3 deletions ModuleUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def update_command():
subprocess.call([sys.executable, '-m', 'pip', 'install', '-r', file, '--upgrade'])


def update(yes = False, force = False):
def update(yes=False, force=False):
global update_ran
if not update_ran:
update_ran = True
Expand All @@ -38,9 +38,8 @@ def update(yes = False, force = False):
for line in requirementsfile:
if line.startswith('https://'):
# extract name and version from url
url = line.split(';')[0]
wheel = line.split('/')[-1]
name, version, _ = wheel.split('-',2)
name, version, _ = wheel.split('-', 2)
line = f'{name}=={version}'
requirements = pkg_resources.parse_requirements(line)
for requirement in requirements:
Expand All @@ -58,6 +57,7 @@ def update(yes = False, force = False):

if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser(description='Install archipelago requirements')
parser.add_argument('-y', '--yes', dest='yes', action='store_true', help='answer "yes" to all questions')
parser.add_argument('-f', '--force', dest='force', action='store_true', help='force update')
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
import sys
import sysconfig
from pathlib import Path

import ModuleUpdate
# I don't really want to have another root directory file for a single requirement, but this special case is also jank.
# Might move this into a cleaner solution when I think of one.
with open("freeze_requirements.txt", "w") as f:
f.write("cx-Freeze>=6.9\n")
ModuleUpdate.requirements_files.add("freeze_requirements.txt")
ModuleUpdate.requirements_files.add(os.path.join("WebHostLib", "requirements.txt"))
ModuleUpdate.update()

import cx_Freeze
from kivy_deps import sdl2, glew
from Utils import version_tuple
Expand Down

0 comments on commit c7e87bc

Please sign in to comment.