Merge branch 'DoorDevUnstable' of github.com:aerinon/ALttPDoorRandomizer into DoorDevUnstable
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -30,5 +30,7 @@ resources/user/*
|
|||||||
|
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
|
get-pip.py
|
||||||
|
|
||||||
venv
|
venv
|
||||||
test
|
test
|
||||||
|
|||||||
13
docs/BUILDING.md
Normal file
13
docs/BUILDING.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Running from source
|
||||||
|
|
||||||
|
1. Get [python](http://python.org/downloads)
|
||||||
|
1. Get the [Door Randomizer Unstable source code](https://github.com/Aerinon/ALttPDoorRandomizer/archive/DoorDevUnstable.zip)
|
||||||
|
1. Install Platform-specific dependencies
|
||||||
|
1. Run `DoorRandomizer.py` for command-line script
|
||||||
|
1. Run `Gui.py` for user interface
|
||||||
|
|
||||||
|
## Platform-specific dependencies
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
* Run `resources/ci/common/local_install.py`
|
||||||
39
resources/ci/common/get_get_pip.py
Normal file
39
resources/ci/common/get_get_pip.py
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import common
|
||||||
|
import urllib.request, ssl
|
||||||
|
import subprocess # do stuff at the shell level
|
||||||
|
|
||||||
|
env = common.prepare_env()
|
||||||
|
|
||||||
|
def get_get_pip():
|
||||||
|
print("Getting pip getter!")
|
||||||
|
#make the request!
|
||||||
|
url = "https://bootstrap.pypa.io/get-pip.py"
|
||||||
|
context = ssl._create_unverified_context()
|
||||||
|
req = urllib.request.urlopen(url, context=context)
|
||||||
|
got_pip = req.read().decode("utf-8")
|
||||||
|
|
||||||
|
with open("get-pip.py", "w") as g:
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url,
|
||||||
|
data=None,
|
||||||
|
headers={
|
||||||
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
req = urllib.request.urlopen(req, context=context)
|
||||||
|
data = req.read().decode("utf-8")
|
||||||
|
g.write(data)
|
||||||
|
|
||||||
|
# get executables
|
||||||
|
# python
|
||||||
|
# linux/windows: python
|
||||||
|
# macosx: python3
|
||||||
|
PYTHON_EXECUTABLE = "python3" if "osx" in env["OS_NAME"] else "python"
|
||||||
|
print("Getting pip!")
|
||||||
|
subprocess.check_call([PYTHON_EXECUTABLE,"get-pip.py"])
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
import pip
|
||||||
|
except ImportError:
|
||||||
|
get_get_pip()
|
||||||
@@ -1,27 +1,30 @@
|
|||||||
import common
|
import common
|
||||||
import os # for env vars
|
|
||||||
import subprocess # do stuff at the shell level
|
import subprocess # do stuff at the shell level
|
||||||
|
|
||||||
env = common.prepare_env()
|
env = common.prepare_env()
|
||||||
|
|
||||||
# get executables
|
def run_install():
|
||||||
# python
|
# get executables
|
||||||
# linux/windows: python
|
# python
|
||||||
# macosx: python3
|
# linux/windows: python
|
||||||
# pip
|
# macosx: python3
|
||||||
# linux/macosx: pip3
|
# pip
|
||||||
# windows: pip
|
# linux/macosx: pip3
|
||||||
PYTHON_EXECUTABLE = "python3" if "osx" in env["OS_NAME"] else "python"
|
# windows: pip
|
||||||
PIP_EXECUTABLE = "pip" if "windows" in env["OS_NAME"] else "pip3"
|
PYTHON_EXECUTABLE = "python3" if "osx" in env["OS_NAME"] else "python"
|
||||||
PIP_EXECUTABLE = "pip" if "osx" in env["OS_NAME"] and "actions" in env["CI_SYSTEM"] else PIP_EXECUTABLE
|
PIP_EXECUTABLE = "pip" if "windows" in env["OS_NAME"] else "pip3"
|
||||||
|
PIP_EXECUTABLE = "pip" if "osx" in env["OS_NAME"] and "actions" in env["CI_SYSTEM"] else PIP_EXECUTABLE
|
||||||
|
|
||||||
# upgrade pip
|
# upgrade pip
|
||||||
subprocess.check_call([PYTHON_EXECUTABLE,"-m","pip","install","--upgrade","pip"])
|
subprocess.check_call([PYTHON_EXECUTABLE,"-m","pip","install","--upgrade","pip"])
|
||||||
|
|
||||||
# pip version
|
# pip version
|
||||||
subprocess.check_call([PIP_EXECUTABLE,"--version"])
|
subprocess.check_call([PIP_EXECUTABLE,"--version"])
|
||||||
# if pip3, install wheel
|
# if pip3, install wheel
|
||||||
if PIP_EXECUTABLE == "pip3":
|
if PIP_EXECUTABLE == "pip3":
|
||||||
subprocess.check_call([PIP_EXECUTABLE,"install","-U","wheel"])
|
subprocess.check_call([PIP_EXECUTABLE,"install","-U","wheel"])
|
||||||
# install listed dependencies
|
# install listed dependencies
|
||||||
subprocess.check_call([PIP_EXECUTABLE,"install","-r","./resources/app/meta/manifests/pip_requirements.txt"])
|
subprocess.check_call([PIP_EXECUTABLE,"install","-r","./resources/app/meta/manifests/pip_requirements.txt"])
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
run_install()
|
||||||
|
|||||||
8
resources/ci/common/local_install.py
Normal file
8
resources/ci/common/local_install.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import install
|
||||||
|
import get_get_pip
|
||||||
|
|
||||||
|
# get & install pip
|
||||||
|
get_get_pip.get_get_pip()
|
||||||
|
|
||||||
|
# run installer
|
||||||
|
install.run_install()
|
||||||
Reference in New Issue
Block a user