pixi icon indicating copy to clipboard operation
pixi copied to clipboard

refactor: factor gateway data fetch and solve into a function

Open olivier-lacroix opened this issue 1 year ago • 7 comments

A follow-up on https://github.com/prefix-dev/pixi/pull/1767

olivier-lacroix avatar Aug 12 '24 12:08 olivier-lacroix

Progress report is not the best, as messages such as fetching repodata for environment can end up being displayed a fair few times. Is there a way to make this better?

olivier-lacroix avatar Aug 12 '24 13:08 olivier-lacroix

Progress report is not the best, as messages such as fetching repodata for environment can end up being displayed a fair few times. Is there a way to make this better?

Yes but it requires implementing a Reporter.

baszalmstra avatar Aug 12 '24 15:08 baszalmstra

@baszalmstra I am not sure what this entails. But it does not sound straightforward 🥲 . Is it worth it? Or should we pull the messaging out of the function and wrap it when / it needed where it is used?

olivier-lacroix avatar Aug 13 '24 10:08 olivier-lacroix

Yeah that sounds fair! 👍

baszalmstra avatar Aug 13 '24 11:08 baszalmstra

Yeah that sounds fair! 👍

Actually that does not work. Even with the messaging outside of the loop, the iterator is still there waiting... Reporter it is then :-)

olivier-lacroix avatar Aug 13 '24 11:08 olivier-lacroix

Rattler-build has a custom implementation here: https://github.com/prefix-dev/rattler-build/blob/a28628bc6d29e227dffc1a64c27fa5f0b50f7dc9/src/render/solver.rs#L136

Its not great but might serve as inspiration!

baszalmstra avatar Aug 20 '24 08:08 baszalmstra

Hi guys! What is the status of this PR @olivier-lacroix @baszalmstra?

tdejager avatar Sep 09 '24 08:09 tdejager

Most of this PR has become irrelevant, due to numerous changes to pixi global. I have just kept a simple refactor of repodata_gateway function and reset the rest.

Note: not sure a trait is really needed to encapsulate that method?

olivier-lacroix avatar Jan 12 '25 04:01 olivier-lacroix