-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open project after exporting -- improve iteration on lovejs builds #12
Comments
#14 fixes that Fatal Python error, and it allows me to use this config to improve testing: postbuild = [
"unzip {build_directory}/lovejs/projectname-lovejs.zip -d {build_directory}/lovejs",
"start http://127.0.0.1:8000", # use open or xdg-open on macos/linux
"python -m http.server 8000 --bind 127.0.0.1 --directory {build_directory}/lovejs/projectname",
] Iteration is now much quicker:
An |
What exactly would that |
Passing desktopunzip the package and do lovejsunzip the package and do: import http.server
import socketserver
import webbrowser
import os
PORT = 8000
# open first because serve_forever blocks
webbrowser.open(f'http://127.0.0.1:{PORT}')
# SimpleHTTPRequestHandler hosts cwd
os.chdir("{build_directory}/lovejs/{projectname}".format(**get_makelove_params())) # TODO
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
try:
httpd.serve_forever()
except Exception:
httpd.shutdown() |
Since lovejs seems to be tricky to get working, it would be nice to have a better flow for testing it.
Currently:
lovejs doesn't have an "artifacts" option for creating unzipped packages.
In theory, you could do something like this:
However, I've found that when makelove executes commands it doesn't seem to have the same PATH as where makelove is executed from, so unzip.exe and python.exe are not in the PATH (I'm on Win10 and both are installed via scoop). Using absolute paths fixes unzip, but I cannot get python to execute -- it always fails with "Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python".
However, since makelove is python, these steps should be doable entirely internally. An
--open
command that would launch the executable for desktop platforms and unzip and open an http.server for lovejs.The text was updated successfully, but these errors were encountered: