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

Is there a way to show a message to the user during the environment bootstrapping phase? #246

Open
itsthejoker opened this issue Nov 9, 2023 · 3 comments

Comments

@itsthejoker
Copy link

Hi, all! I really enjoy working with Shiv, and have most recently used it to bundle some internal developer tooling for my team. After an update, there's a several-second delay while it unpacks the updated environment (that's just part of life), and I'd like to show a message to the console on first run that is essentially just "Setting up environment..." that disappears when the bootstrap section is done.

Is this possible? If so, can you point me in the right direction as to how I might be able to implement this into my project?

Cheers!

@lorencarvalho
Copy link
Contributor

lorencarvalho commented Feb 6, 2024

Hi @itsthejoker,

Yes! The "--preamble" argument should work nicely for what you want. This basically allows you to ship any executable (or Python script) with your pyz, and executes it during the bootstrap phase :)

The docs can be found here: https://shiv.readthedocs.io/en/latest/?badge=latest#preamble

@itsthejoker
Copy link
Author

Hi @lorencarvalho! My issue is in the docs: "(after extracting dependencies but before invoking an entry point / console script)." I want to display a notice to the user while dependencies are being extracted, as this can take a bit for my shiv app.

@gleesonger
Copy link

I have a very similar need as OP.

In my case, I have a GUI application which is launched with "pyw" on windows, so there is no console interface. The end user launches the program and then needs to wait several seconds before they see anything. During this time, they are wondering if they correctly launched the program or not.

Having the ability to run code before any unpacking would be useful as an interface in base Python could be shown before the dependencies become available.

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

No branches or pull requests

3 participants