Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Aug 31, 2020

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

@paradigm
Copy link
Member

paradigm commented Sep 2, 2020

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
Copy link
Author

ghost commented Sep 3, 2020

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
Copy link
Member

paradigm commented Sep 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant