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

pack as single executable #17

Open
koiuo opened this issue Aug 31, 2018 · 0 comments
Open

pack as single executable #17

koiuo opened this issue Aug 31, 2018 · 0 comments

Comments

@koiuo
Copy link
Owner

koiuo commented Aug 31, 2018

It is a hassle to distribute and use utility like this as a python package. Single file executable would be amazing.

Executable should be shipped with all its dependencies (likely in a virtualenv, idk if there are other options in python).

There are some options available: zipapp, pyinstaller, shiv, etc..

So far I tried playing with zipapp and following issues block further progress:

  • can't ship resources with the app. pkg_resources won't work from zipapp (can be workarounded by storing resources as strings in code)
  • can't (easily) ship dependencies that have native code in them. 2 sub-issues here:
    ** for example, pyyaml has dependency to libyaml. Zipapp's virtualenv will contain libyaml built for architecture of the host, where executable was built. So no "cross-building" here and sems that vm is necessary.
    ** zipapp documentation says, that due to some limitation native libraries can'be shipped within zipapp at all (however pyyaml worked somehow for me. Haven't investiaged yet)
  • randrctl-auto script. It is a wrapper script that makes sure randrctl makes calls to xrandr under the user who owns X session (randrctl-auto is executed from udev rule and thus is always executed from root). I've seen python offers set_uid method in its api, so seems that it should be possible for randrctl to change the user.
  • performance. Executing zipapp on my machine takes at least twice longer, than executing randrctl normally as python script.

Any suggestions or help implementing this are hightly appreciated.

@koiuo koiuo changed the title Pack as a single-file executable pack as single executable Sep 1, 2018
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

1 participant