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

Offer redirection of micropip.install console messages and data #23

Open
bollwyvl opened this issue Nov 13, 2022 · 1 comment
Open

Offer redirection of micropip.install console messages and data #23

bollwyvl opened this issue Nov 13, 2022 · 1 comment

Comments

@bollwyvl
Copy link

References

Elevator pitch

Offer a way for programs to intercept and make use of micropip.install status and error information.

Motivation

During micropip.install, a lot of useful information is sent to the browser console which might actually be useful to display to users, such as drawing progress bars to indicate "5 of 10 packages are loading", or even "5MB of 50MB have been loaded".

But more crucially, having access to error conditions in a predictable manner instead of tracebacks in the browser console (if even reachable, e.g. on mobile) would help create more predictable experiences

Design Ideas

  • accept error_callback and message_callback, similar to the typescript side
    • hand back some dict that includes a message, but ideally also some idea of progress, e.g. stage and total_packages, start_time, duration
    • these could be well-typed (even TypeDicts) or have a schema
  • use a more pythonic approach, using a log=logger.getLogger()
    • potentially more featureful
      • less type-able
    • would make it easy to add DEBUG messages, etc. that shouldn't always be displayed without inventing some new system
@bollwyvl bollwyvl mentioned this issue Nov 14, 2022
@rth
Copy link
Member

rth commented Nov 15, 2022

Thanks for the proposal! I certainly see the use case for this so +1 from me. Personally, I have no strong preferences between string and structured logging, it's mostly a question for downstream packages.

Someone would need to design the API and implement this though :)

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

No branches or pull requests

2 participants