bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
616 stars 69 forks source link

Add pip pmm support (draft) #198

Open ghost opened 4 years ago

ghost commented 4 years ago

First draft of attempting to add pip support for pmm. Any ways I could improve it?

paradigm commented 4 years ago

Seems like a good start.

For things like

implementations["pip", "remove-packages-limited"]  = "strat -r ${stratum} pip ${flags} remove ${items}"
implementations["pip", "remove-packages-full"]     = ""

you'll want to populate both. Consider what happens if a user runs something like pmm purge <pip-package> here in contrast to what the user probably wants.

For

implementations["pip", "search-for-package-by-name"]   = "" # Can't figure out how to
implementations["pip", "search-for-package-by-all"]    = "" # differentiate between the two

I think you can

strat -r ${stratum} pip search ${items} | awk '{print$1}'

for the first and

strat -r ${stratum} pip search ${items} | awk '{print$1}' | grep ${items}

for the latter. If you figure out how to list available packages, | grep ${items} on it might be better or worse depending on how pip's search and list system works.

I don't know pip's nuances at all for things like populating other fields or explicit vs implicit handling.

ghost commented 4 years ago

Thanks for responding! For "reinstall-packages" implementation, would it be clunky to use pip uninstall <pkg> && pip install <pkg>? Also, I added your suggestions.

paradigm commented 4 years ago

I'd prefer that to leaving it blank and confusing users when they try it.