Skip to content

Use equivalent of --onefile for the spec file #203

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

Merged
merged 1 commit into from
Jul 26, 2018

Conversation

mgorzel
Copy link
Contributor

@mgorzel mgorzel commented Jul 26, 2018

That creates a single executable file instead of a dir (win) and ~halves the size of the mac executable.

That creates a single executable file instead of a dir (win) and ~halves the size of the mac executable.
Copy link
Contributor

@ascherkus ascherkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this assume that --onefile (and --windowed?) is being used? Is it even possible

If so, it'd be nice to either:

  1. Detect (somehow?) inside the spec file that it's been enabled
  2. At a minimum, include some documentation in the file and/or in the README.md

@mgorzel
Copy link
Contributor Author

mgorzel commented Jul 26, 2018

Thanks Andrew!

Does this assume that --onefile (and --windowed?) is being used? Is it even possible

Yes, indeed. So now running:

pyinstaller spatial_media_metadata_injector.spec

Should be equivalent to:

pyinstaller --onefile --windowed --clean --name "Spatial Media Metadata Injector" gui.py

Previously, only on Mac a single application bundle was produced.

If so, it'd be nice to either:

Detect (somehow?) inside the spec file that it's been enabled

In the spec file:

--windowed sets console=False. Also, on a Mac it adds:

app = BUNDLE(coll,
             name='Spatial Media Metadata Injector.app',
             icon=None,
             bundle_identifier=None)

Which results in a single app bundle.

--onefile removes COLLECT and moves the binaries, datas and zipfiles to the EXE. That results in a single exe on Win and Mac (inside the app bundle).

AFAIK, --clean is used already if the pyinstaller builds from a spec file.

At a minimum, include some documentation in the file and/or in the README.md

Building a standalone GUI application from README.md instructions should now result in similar binaries as used in the Release (e.g. singe executables), so not sure if updates to the README.md should be necessary? 'In the file', do you mean we could document which parts correspond to the effect of the flags --windowed and --onefile?

Cheers,

Marcin

@ascherkus
Copy link
Contributor

Thanks for the explanation - that clears up everything. Indeed no README.md changes necessary!

@ascherkus ascherkus merged commit 0069238 into master Jul 26, 2018
@Boscop
Copy link

Boscop commented Nov 10, 2020

If anyone here is wondering how to turn the CLI into an exe, I did it like this:

pip install pyinstaller==3.6
pyinstaller --onefile --name spatialmedia spatialmedia\__main__.py

Which produced dist\spatialmedia.exe.

It also works with Angelo Farina's fork which supports higher order ambisonics:
http://www.angelofarina.it/Public/Jump-Videos/spatial-media-2.1-HOA.zip


Btw, is this spatial-media python package compatible with Python 3?
The latest pyinstaller only supports Python 3.

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

Successfully merging this pull request may close these issues.

3 participants