Skip to content
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

Setup pre-compiled binaries for different platforms [Enhancement] #12

Open
jfmherokiller opened this issue Nov 5, 2019 · 3 comments
Open

Comments

@jfmherokiller
Copy link

I was wondering if you had any plans for say pre-made binaries that the user could just download and run?

I locally setup a setup a working singlefile py2exe setup.py (using 32bit 2.7 python) and I edited main.py to correctly support the difference in the zip below.
LSL-PyOptimizer.zip

the specifics of the change to main.py are here

def main(argv):
    """Main executable."""
+    import os
+
+    if hasattr(sys,"frozen") and sys.frozen in ("windows_exe", "console_exe"):
+       lslopt.lslcommon.DataPath=(os.path.dirname(os.path.abspath(sys.executable)) + os.sep)
+   else:
    # If it's good to append the basename to it, it's good to append the
    # auxiliary files' names to it, which should be located where this file is.
        lslopt.lslcommon.DataPath = __file__[:-len(os.path.basename(__file__))]
@Sei-Lisa
Copy link
Owner

Sei-Lisa commented Nov 5, 2019

Thanks for the patch. I don't plan to offer executables; the only supported execution format is downloading and running the interpreter. However, I don't mind including a patch that makes it easier for third parties to create executables, as long as it's well understood that I don't endorse them and I explicitly refuse any responsibility about them.

Note that os is already imported, so you don't need to re-import it

Please let me know what license terms you want to apply to your contribution, or if you accept placing these changes under the same GPL3 license terms as the rest of the code, as well as under what name you want to be credited. A pull request is preferred, but I can deal with the above patch otherwise.

Edit: Do I understand it right that setup.py does not need to import py2exe or os?

@jfmherokiller
Copy link
Author

jfmherokiller commented Nov 8, 2019

I accept the same license as the project. yes if you want to build a single exe file you need to import py2exe atleast for my method. I chose the py2exe route because I don't know how to setup setup.py for a normal command line utility using setup tools or such. my real end goal was to make a setup.py that you could just do python2 setup.py install and have a working command line utility.

@jfmherokiller
Copy link
Author

Also side note I might try to see if I can make basic continuous integration setup just in case in the future if self contained binaries are desired we will have a system in place. ( This is for possibly vscode extensions or extensions for other editors who wish to use this project as either a optimizer or just a simple linter (eg being able to check if the code is syntaticly valid before releasing it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants