Replicate Pkg.jl progress bar

Hi,

Is there a way to replicate exactly the progress bar of julia package manager Pkg.jl ?

The progress bar appears when a project is pre-compiling the necessary libraries. It displays spinning wheels for multiple package at the same time…etc. It seems precimpilation is happening in parallel, but i might be wrong about that.

I like this progress bar because it tells which packages are being processed (in parallel), which one complete successfully or not.

I noticed that there is a module called MiniProgressBars in Pkg.jl but how it is used seems complicated. Maybe someone has an example of how it works?

Thank you

The precompilation animation isn’t abstracted unfortunately. It’s baked into a single Pkg.precompile function.

It could be brought out, but be aware that MiniProgressBars is an internal, and a progress bar is unlikely to become part of the public API of Pkg.

I’d recommend porting the ‘precompile’ progress animation to one of the progress bar packages.

3 Likes

Thank you @ianshmean . Is there a way to trigger that precompile function (let’s say for a local julia package) so maybe I can then step into the function to see how it works? And “extract” the progress bar?

Thank you

This sounds like it might be an XY problem. If you’re just looking for progress bars in general (and unrelated to Pkg), ProgressMeter.jl has progress bars and progress spinners (the appearance of either is customizable).

@halleysfifthinc , thank you. I know about ProgressMeter but I was unable to reproduce the behaviour that I can observe in Pkg.jl. If you know how to do that, I am curious to know how you do it.

The desired behaviour observed in Pkg.jl being multiple, simultaneously updating progress bars/spinners? I don’t think ProgressMeter can do that but that is a feature I would definitely use if it were to be added.