-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Investigate python-build-standalone #22
Comments
I followed the https://python-build-standalone.readthedocs.io/en/latest/building.html#macos instructions and I'm now running the build - it's taken several minutes so far. Looks like it will take a while to finish. I ran this:
|
Rather than waiting for it to compile, I decided to try a build from https://github.com/indygreg/python-build-standalone/releases/tag/20210724 Looks like these are the likely options: cpython-3.9.6-aarch64-apple-darwin-debug-20210724T1424.tar.zst 18.8 MB cpython-3.9.6-aarch64-apple-darwin-install_only-20210724T1424.tar.gz 38.3 MB cpython-3.9.6-aarch64-apple-darwin-lto-20210724T1424.tar.zst 28.8 MB cpython-3.9.6-aarch64-apple-darwin-pgo+lto-20210724T1424.tar.zst 31.3 MB cpython-3.9.6-aarch64-apple-darwin-pgo-20210724T1424.tar.zst 21.5 MB I have no idea what the suffixes such as |
I'll try that one. |
This gave me a
I'll try https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-apple-darwin-install_only-20210724T1424.tar.gz instead (after
|
It's pretty big unzipped though:
|
I then ran:
Does this survive being moved elsewhere on the filesystem? No it does not:
|
But this DOES work:
|
This is an interesting option then: it looks like I can create a standalone Python environment using this which could, potentially, be bundled up as part of the Electron The downside is that it's BIG: 100+MB of disk space. I can reduce that down a bit though:
Looks like I can save 23MB by deleting I'm loathe to strip out parts of the standard library though since future Datasette plugins might depend on them. |
Having Answer: on macOS it stashes them in |
This works:
And then to run it:
|
So... one option would be to bundle standalone Python with the Electron app and then use its This would support both plugin installations AND upgrading Datasette itself! |
Are there any other apps on my machine that are doing that kind of thing already?
Shows me that both Maybe OBS too? |
I am going to try this:
|
I'm going to commit to this mechanism, at least for the moment. |
Wrote this up as a TIL: https://til.simonwillison.net/electron/python-inside-electron - it's also mentioned in https://simonwillison.net/2021/Sep/8/datasette-desktop/ |
https://python-build-standalone.readthedocs.io/en/latest/building.html#macos
Since I would ideally like Datasette.app to support Python plugins, maybe what I really need is a full-blown Python system tucked away inside the
Datasette.app
macOS package, with the ability to install extra packages into it?if so,
python-build-standalone
could be relevant - it's part of the PyOxidizer project.Maybe I don't need any of the mechanisms from things like PyInstaller or PyOxidizer that combine my code together into a single executable - I just need to be sure that when a user installs the Datasette.app application it has a guaranteed Python environment that it can use to run
datasette
and its plugins.The text was updated successfully, but these errors were encountered: