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

Option to stop uv self update from adding . $HOME/.local/share/cargo/env? #6932

Closed
baggiponte opened this issue Sep 2, 2024 · 9 comments · Fixed by #7090
Closed

Option to stop uv self update from adding . $HOME/.local/share/cargo/env? #6932

baggiponte opened this issue Sep 2, 2024 · 9 comments · Fixed by #7090
Labels
documentation Improvements or additions to documentation releases Related to building and distributing release artifacts of uv upstream An upstream dependency is involved

Comments

@baggiponte
Copy link

baggiponte commented Sep 2, 2024

Ciao! With rust on my machine already, my shell already sources the cargo/env script. Every time that I upgrade uv to a newer version with uv self update, the line is added to my zshrc and fish conf dir (which I do not use). This is absolutely nothing high priority, but I was wondering if you would consider setting an option to disable this behaviour.

@AbdealiLoKo
Copy link

I think you may be looking for --no-modify-path ?

@baggiponte
Copy link
Author

I think you may be looking for --no-modify-path ?

Interesting. I don't see it as an option for uv self update though.

@baggiponte baggiponte changed the title Option to stop uv from adding . $HOME/.local/share/cargo/env? Option to stop uv self update from adding . $HOME/.local/share/cargo/env? Sep 2, 2024
@charliermarsh charliermarsh added upstream An upstream dependency is involved releases Related to building and distributing release artifacts of uv labels Sep 2, 2024
@tpgillam
Copy link

tpgillam commented Sep 4, 2024

Seconded - I upgraded from uv 0.4.3 -> 0.4.4 just now with uv self update, and it appended ~/.bashrc with:


. "$HOME/.cargo/env"

I would certainly prefer if the self update command by default did not modify any configuration files. My reasoning is that, if updating, the user has presumably already set their paths in the way that they want (in my case I want my .bashrc portable between different machines, so I don't put any paths directly in that file).

Only a small niggle though. I just have to do a git restore on it every time I upgrade, which is mildly inconvenient at worst!

@baggiponte
Copy link
Author

Maybe one could do uv self update --ensurepath or a flag like that and have this behaviour to be opt-in.

@zanieb
Copy link
Member

zanieb commented Sep 4, 2024

Looking into upstream support for this — I don't think we can add it until they do.

@zanieb
Copy link
Member

zanieb commented Sep 5, 2024

Can you try setting INSTALLER_NO_MODIFY_PATH=1 during the update?

@tpgillam
Copy link

tpgillam commented Sep 5, 2024

I'm on a different machine today (Fedora 39), where it doesn't try to modify ~/.bashrc, but instead creates or modifies ~/.profile

Can you try setting INSTALLER_NO_MODIFY_PATH=1 during the update?

Yes - this seems to do the trick (installed 0.4.4 and tested on uv self upgrade thereafter).

@zanieb
Copy link
Member

zanieb commented Sep 5, 2024

Great — we can document that.

@baggiponte
Copy link
Author

Confirm too, setting INSTALLER_NO_MODIFY_PATH=1 works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation releases Related to building and distributing release artifacts of uv upstream An upstream dependency is involved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants