8000 Add option to bundle app with pyinstaller by Spacetown · Pull Request #661 · gcovr/gcovr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add option to bundle app with pyinstaller #661

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 13 commits into from
Sep 29, 2022

Conversation

Spacetown
Copy link
Member

This PR adds an additional option to bundle the current version installed with pip into a standalone executable with pyinstaller:

Experimental Options:
  Experimental options are for testing only and can be changed/removed in
  future releases.

  --bundle-app          Build a standalone application from the current gcovr
                        installation. To add additional options to pyinstaller
                        use e.g.: --bundle-app -- --help

The main script used to generate the application is part of gcovr installation. In the bundled application the option and option group is removed.
The pipeline test run also a test for the bundled application which checks if the help is printed.

Closes #486

@codecov
Copy link
codecov bot commented Aug 19, 2022

Codecov Report

Base: 95.19% // Head: 95.19% // No change to project coverage 👍

Coverage data is based on head (8811087) compared to base (fc65655).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #661   +/-   ##
=======================================
  Coverage   95.19%   95.19%           
=======================================
  Files          24       24           
  Lines        3496     3496           
  Branches      661      661           
=======================================
  Hits         3328     3328           
  Misses         94       94           
  Partials       74       74           
Flag Coverage Δ
ubuntu-18.04 93.93% <ø> (ø)
windows-2019 94.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@latk
Copy link
Member
latk commented Aug 19, 2022

I have no idea how PyInstaller works. Does this option have to be part of the program being packaged, or could it be a separate script, or could we just tell users interested in this to clone the repository and run some Nox command?

I think it's great to include (low-maintenance) entry-points that can be used for non-PyPI distribution, but the proposed design strikes me more like a hack, not like something I'd feel comfortable shipping.

@Spacetown
Copy link
Member Author

Pyinstaller needs a script which is parsed to get the imports. For the modules the pyc files are created and packed together with the python interpreter. A bootstrap code unpacks all, setsup the environment and executes it.
Of course it can also be done in nox. Since this is something for more experienced users I thought a option would be better. But you're right, it's more like a little hack. I'll move it completely to the nox level and add it to the documentation. Should this go to cookbook?

@latk
Copy link
Member
latk commented Aug 20, 2022

I'll move it completely to the nox level and add it to the documentation. Should this go to cookbook?

Ok, from that description it really sounds like this should be a separate script, not part of the gcovr program. Doing this via Nox sounds fine.

Yes, adding it to the docs would be good for discoverability. Maybe a cookbook entry, and a link to that entry from the installation guide?

Copy link
Member
@latk latk left a comment

Choose a reason for hiding this comment

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

Ok, I like this. Lots of smaller questions though.

@Spacetown Spacetown force-pushed the add_pyinstaller_config branch from 898a6d9 to 0eb8649 Compare September 6, 2022 19:31
@Spacetown Spacetown marked this pull request as draft September 6, 2022 19:32
@Spacetown Spacetown force-pushed the add_pyinstaller_config branch from 0eb8649 to 54b3355 Compare September 6, 2022 19:55
@Spacetown Spacetown marked this pull request as ready for review September 6, 2022 20:05
@Spacetown Spacetown requested a review from latk September 6, 2022 20:05
@Spacetown Spacetown force-pushed the add_pyinstaller_config branch from a021ef6 to 8811087 Compare September 29, 2022 18:39
@Spacetown Spacetown merged commit cd6420c into gcovr:master Sep 29, 2022
@Spacetown Spacetown deleted the add_pyinstaller_config branch September 29, 2022 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build portable single executable
2 participants
0