Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip Auto Reshim Support #136

Merged
merged 2 commits into from
Jul 20, 2022
Merged

Pip Auto Reshim Support #136

merged 2 commits into from
Jul 20, 2022

Conversation

matan129
Copy link
Contributor

@matan129 matan129 commented May 2, 2022

Solves #37. Inspired by the npm version.

@johnklehm
Copy link

@danhper @pierreneter

@humitos
Copy link

humitos commented Jun 1, 2022

Hi! I came here after reading multiple issues on asdf, the pre/post hooks implemented and the revert of them because of the problem reported with exec.

I'd like to see this feature merged into the asdf-python plugin since it seems that does not modify the core of asdf and only wraps the pip command in a basic way to reshim if it was called with install or uninstall --which sounds to exactly what the user will do manually anyway. Actually, this is what pyenv has been doing as well https://github.com/pyenv/pyenv/blob/master/pyenv.d/exec/pip-rehash/pip#L26

I was wondering if we want to apply the same logic for conda and easy_install as they do (see https://github.com/pyenv/pyenv/tree/master/pyenv.d/exec/pip-rehash). Maybe for other package managers like pipenv, poetry and pdm as well? (I'm not sure about these ones, but worth asking about them 😄 )

@matan129
Copy link
Contributor Author

@danhper thoughts?

@danhper
Copy link
Collaborator

danhper commented Jul 20, 2022

Hey, sorry for the delay!
This looks great, thanks a lot!

@danhper danhper merged commit dcba495 into asdf-community:master Jul 20, 2022
humitos added a commit to readthedocs/readthedocs-docker-images that referenced this pull request Mar 9, 2023
This will allow us to be smarter about _when to reshim_.

With this update, it will be handled automatically by `asdf` and we won't
require a custom chunk of code in our application:

https://github.com/readthedocs/readthedocs.org/blob/a5965129c61b9bcdff2f2098ff7ce7f8c093dc74/readthedocs/doc_builder/director.py#L373-L386

Currently, multi-lines commands that install something with `pip` and immediate
after that, inside the multi-line command try to use the executable installed,
fail because it's not automatically reshimed.

By reshiming at `asdf` level, this case will be solved.

Related: readthedocs/readthedocs.org#9150 (comment)
Related: asdf-community/asdf-python#136
humitos added a commit to readthedocs/readthedocs-docker-images that referenced this pull request Mar 21, 2023
* asdf: update `asdf` and all its plugins

This will allow us to be smarter about _when to reshim_.

With this update, it will be handled automatically by `asdf` and we won't
require a custom chunk of code in our application:

https://github.com/readthedocs/readthedocs.org/blob/a5965129c61b9bcdff2f2098ff7ce7f8c093dc74/readthedocs/doc_builder/director.py#L373-L386

Currently, multi-lines commands that install something with `pip` and immediate
after that, inside the multi-line command try to use the executable installed,
fail because it's not automatically reshimed.

By reshiming at `asdf` level, this case will be solved.

Related: readthedocs/readthedocs.org#9150 (comment)
Related: asdf-community/asdf-python#136

* Docs: update readme to mention `ubuntu-22.04` and `buildx`

* Tests: update version to check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants