From 9d209383a5df1c6caf3130a4d57d646d7b7addf9 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Wed, 5 Feb 2020 06:42:31 -0800 Subject: [PATCH] added snippet to install pip reqs --- README.md | 2 +- tools/snippets | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de2768fb..bf2b990d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The Ballistica project is the foundation for the next generation of [BombSquad]( * A: No, BombSquad is still BombSquad. 'Ballistica' is simply the new name for the engine/app-framework. This way it can also be used for other game/app projects without causing confusion (though that is mostly theoretical at this point). As a modder, the biggest changes you will notice is 'ba' prefixes in the API instead of 'bs' and naming that follows Python PEP8 standards (underscores and lowercase instead of camel-case). So `bs.playSound(mySound)` in the old system might look like `ba.playsound(mysound)` in the new. You may also see the word 'BallisticaCore' show up various places, which in actual releases gets replaced by 'BombSquad'. * **Q: Does this mean BombSquad is open source?** -* A: Yes and no. All code contained in this repo is MIT licensed and free for use anywhere. This includes game scripts, pipeline tools, etc. Over time I hope to expand this to include at least some of the binary engine sources. Anything not directly contained in this repository, however, even if automatically downloaded by build scripts, is still proprietary and cannot be redistributed without explicit consent. This includes assets and game binaries. So in a nutshell: create and share mods to your heart's content, but please don't distribute your own complete copies of the game. Please email support@froemling.net if you have any questions about this. +* A: Yes and no. All code contained in this repo is MIT licensed and free for use anywhere. This includes game scripts, pipeline tools, etc. Over time I hope to expand this to include at least some of the binary engine sources. Anything not directly contained in this repository, however, even if automatically downloaded by build scripts, is still proprietary and cannot be redistributed without explicit consent. This includes assets and game binaries. So in a nutshell: create and share mods to your heart's content, but please don't distribute your own complete copies of the game without permission. Please email support@froemling.net if you have any questions about this. * **Q: Will my existing BombSquad 1.4.x mods still work?** * A: No. All mods will need to be explicitly updated to work with the new ballistica apis in 1.5+. This may or may not be a significant amount of work depending on the mod. I would highly suggest tinkering around with some of the new features in 1.5 such as type-safe Python and dynamic assets before attempting to port any old mods, as some things are done significantly differently now. You may also want to consider simply sticking with 1.4 builds for a while longer, especially for server duties, since they will remain fully compatible with clients running 1.5. The new ballistica APIs may be changing significantly for at least a while as the dust settles, but they will be worth switching to in the end, I promise! diff --git a/tools/snippets b/tools/snippets index 02cf6227..9049387b 100755 --- a/tools/snippets +++ b/tools/snippets @@ -707,14 +707,27 @@ def update_docs_md() -> None: print(f'{docs_path} is up to date.') -def pip_req_list() -> None: - """List Python Pip packages needed for this project.""" +def _get_pip_reqs() -> List[str]: out: List[str] = [] for module in REQUIRED_PYTHON_MODULES: name = module[0] if module[2] is None else module[2] assert isinstance(name, str) out.append(name) - print(' '.join(out)) + return out + + +def list_pip_reqs() -> None: + """List Python Pip packages needed for this project.""" + print(' '.join(_get_pip_reqs())) + + +def install_pip_reqs() -> None: + """Install Python Pip packages needed for this project.""" + from efrotools import PYTHON_BIN + subprocess.run([PYTHON_BIN, '-m', 'pip', 'install', '--upgrade'] + + _get_pip_reqs(), + check=True) + print(f'All pip requirements installed!') def checkenv() -> None: