refactor: Split install_pypi into own pixi_install_pypi crate#4302
refactor: Split install_pypi into own pixi_install_pypi crate#4302haecker-felix wants to merge 13 commits intoprefix-dev:mainfrom
Conversation
794e76f to
37507ed
Compare
There was a problem hiding this comment.
Hey Felix!
Good first start, however, two things that I see that kind of stopped me doing the same thing.
- The
UvResolutionContextis actually not aptly named, as its more aSharedVariableskind of thing and handles more than just resolution. This was kind-of changed over time. Then thepixi_lockfilecrate for just that structure is not correct and that would need to be changed. - The
pixi_environmentis not the correct name for these structures either, except if we move all the enviroment stuff from the main crate in there. Which, just from this PR, I cannot see if that will happen. Otherwisepixi_pypi_prefix/envwould make more sense.
So I'd either rename things first or move other (more) isolated things first.
|
@tdejager ah, sorry, one important thing I forgot to mention is that I intent to move the rest of
Yep, I guess it makes more sense once the rest of
Yep, that's the idea.
I fear it'll be hard to find more isolated things, as for example |
That would provide one of the biggest benefits I think! |
|
Yeah, I can imagine that takes some time, but it will make the rest a lot easier afterwards :) |
…formUnsat, LockedCondaPackages, LockedPypiPackages, PypiRecord, PypiRecordsByName, PixiRecordsByName into pixi_lockfile crate
…h into pixi_lockfile crate
|
I moved some more (somewhat) self-contained stuff into the But I'm not sure if it makes sense to continue down this path. I think I'll end up in a situation that the |
|
Can you point at what part will cause a circular reference? |
|
I'm a bit sorry to barge in here :) But I'd rather first move environment or lock, into its seperate crates, the one that's the least connected at least. Figure out what would cause circular references, then fix that. And then move into |
|
@haecker-felix Oh and seperate PR's for that would be great :) |
|
For example, if I would start with splitting out into
But I can't make I wonder if it would make more sense to have some modules in some It may also complicate stuff in future when you develop something in
That's what I try to do 👍 |
|
@haecker-felix Yeah for sure I'm open to something like They solve this in the following way: https://github.com/astral-sh/uv/blob/main/crates/uv-types/src/traits.rs#L63 Note that they may have |
|
Replaced by #4328 |
This PR moves the
install_pypimod into a newpixi_install_pypicrate. Long term goal is to split all the logic out ofpixiso that it only contains the parts which render the command line interface.Once that is done we can start designing a proper
pixi-apicrate which then gets consumed bypixi(CLI) and laterpixi-gui.Since
install_pypihad some imports from other modules, we also need to move them into separate crates, since we can't depend onpixi(circular dependency).prefix::Prefixintopixi_utilscratepython_statusandpypi_prefixinto newpixi_environmentcrateUvResolutionContextinto newpixi_lockfilecrateNext step is to split out the other modules as well. I'll do that in separate PRs, so the diffs remain "small" / reviewable.