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

Add vf upgrade $venv to upgrade major/minor Python versions #141

Closed
Freso opened this issue Aug 12, 2018 · 10 comments · Fixed by #191
Closed

Add vf upgrade $venv to upgrade major/minor Python versions #141

Freso opened this issue Aug 12, 2018 · 10 comments · Fixed by #191

Comments

@Freso
Copy link

Freso commented Aug 12, 2018

Stock Python venv module has an --upgrade function that lets you upgrade virtualenvs created via that, but that doesn't seem to work with virtualfish created venvs. Having a similar mode for vf (e.g., vf upgrade $venv) would be great.

@RaitoBezarius
Copy link

That'd be really nice, I'm interested into sending a PR for this, how should I proceed?

@justinmayer
Copy link
Owner

Hi Ryan. Your contribution implementing this functionality would be most helpful. Let us know if you have any specific questions. We look forward your pull request! ✨

@RaitoBezarius
Copy link

Hi @justinmayer — thank you! I'm looking at the repo, I see a update_python.fish which looks like exactly what we want, should I just wrap into a command which activates the venv, run the update python with no argument (choosing the default python), and that's it?

@RaitoBezarius
Copy link

It sounds like it has been built for this: 6e269b0

@justinmayer
Copy link
Owner

Ah, so it seems that existing Update Python plugin already addresses this issue. Could you perhaps test it and confirm?

@RaitoBezarius
Copy link

RaitoBezarius commented Nov 16, 2019

@justinmayer It's working ~quite well, I'm not sure if we expect it to restore all packages which were in the former venv (because pip freeze can be itself broken during updates).

I guess all we would like is the ability to get the packages without using pip freeze (by reading the structure ourselves: $VIRTUALFISH_HOME/some-venv/lib/python-old-version/sites-packages/*)

@justinmayer
Copy link
Owner

@RaitoBezarius: Having personally run into situations when Python interpreters have been yanked out from underneath the virtual environments that relied on them (I'm looking at you, Homebrew), I agree that it would be nice to recover from those situations in a more graceful manner than is currently available.

I guess all we would like is the ability to get the packages without using pip freeze (by reading the structure ourselves: $VIRTUALFISH_HOME/some-venv/lib/python-old-version/sites-packages/*)

I agree that may indeed be a good approach, particularly since the installed version numbers are available in the *.dist-info directories. Is this something you might willing to assist with and implement? We could certainly use the help! 😅

@justinmayer
Copy link
Owner

Regarding upgrading virtual environments, I have a WIP solution that I will submit shortly. While I was working on it, I realized that introspecting virtual environment state is difficult and cumbersome, so I came up with a solution via #190 whereby one can run vf ls --details to show outdated/broken Python interpreters.

Anyone have any feedback on its implementation? Comments on PR #190 would be most welcome. 😊

@justinmayer
Copy link
Owner

I submitted a pull request (#191) for the new vf upgrade command in order to (hopefully) get some feedback on its implementation. I also included a screencast to demonstrate the new features, so be sure to check it out.

In addition to the other PR mentioned above, comments on this new PR would also be appreciated: #191

@justinmayer
Copy link
Owner

I'm quite pleased with the new upgrade feature, so it's time to ship 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 a pull request may close this issue.

3 participants