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

Automatically run reshim? #37

Open
fozcodes opened this issue Jul 21, 2018 · 11 comments
Open

Automatically run reshim? #37

fozcodes opened this issue Jul 21, 2018 · 11 comments

Comments

@fozcodes
Copy link

Hey guys,

I use ASDF for a lot of different langs, but in python anytime I install a new package via pip or pip3 I need to run asdf reshim python to get it to load correctly.

Is this intended behaviour? In other langs, e.g., JS, Elixir, Ruby, you don't need to do this.

Thanks!

@mmartinson
Copy link

Good question. This is clearly and issue for others as well. It could be in the docs at least.

@natecox
Copy link

natecox commented Aug 1, 2018

haha, I run into this question every time I get someone new to use asdf.

It's definitely an issue, but because pip isn't a part of asdf I'm not sure that it's within the domain of asdf to modify a workflow. Better documentation is probably the correct solution.

@fozcodes
Copy link
Author

fozcodes commented Aug 2, 2018

🤔 I suppose. But the same argument could be made for bundler in Ruby. Whereas, in Ruby I never have to reshim after installing. Maybe I don't understand the inner workings of pip or pipenv that well. I'm just getting started with Python. It does install the packages as part of the current asdf python and then symlink them, correct?

@natecox
Copy link

natecox commented Aug 2, 2018

You’re probably just getting lucky. I’ve had issues with forgetting to reshim for every language I use asdf for; python, ruby, node, elixir, erlang, elm, etc.

It’s inconsistent and I can’t explain what makes it work fine sometimes and poorly others, but certainly not isolated to python.

I imagine virtualenvs switching their own shimming around probably contributes.

@danhper
Copy link
Collaborator

danhper commented Aug 24, 2018

This is the intended behavior, as I am not a big fan of doing things under the hood.
Automatic reshim has caused quite a few issues with npm global installs too.
That said, I wouldn't mind accepting a PR to reshim automatically as long as we have a way to disable the behavior (maybe through ~/.asdfrc)
Thanks!

@tammersaleh
Copy link

When would the reshim happen? Is the feature request to wrap pip/pip3 with an asdf-aware script that runs reshim at the end?

@danhper
Copy link
Collaborator

danhper commented Sep 20, 2018

I know that other tools (e.g. gem for Ruby or npm for Node) offer post-installation hooks, which avoids the need for a wrapper.
Do you have any idea if such a hook exists for pip?
Otherwise, I think a wrapper could be a decent solution but I wonder if there could be any unwanted side effects?

@dikaio
Copy link

dikaio commented Nov 30, 2018

Wouldn't it be possible to just create an aliases that reshims after each install?

e.g. alias gem install="gem install $ && asdf reshim ruby" and then do the same for pip, rust, node etc.

@danhper
Copy link
Collaborator

danhper commented Dec 3, 2018

This is actually quite similar to what pyenv is doing, for example:
https://github.com/pyenv/pyenv/blob/d08c9cfb362c5a7e18a92acd2253a16935ad9a99/pyenv.d/exec/pip-rehash/pip
I personally do not mind about manually running reshim but is someone wants to send a PR to support this I would not mind merging it either.

@philipbjorge
Copy link

It looks like in master of asdf right now, there is some new support for auto reshimming.

asdf-vm/asdf#409
asdf-vm/asdf#434

@idoo
Copy link

idoo commented Mar 27, 2020

thank you @fozcodes for creating this issue, it works well for me for ruby, however, with python, I have to run reshim manually

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

No branches or pull requests

8 participants