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

vf upgrade yields error when virtual environment does not exist #239

Open
3 of 4 tasks
ammgws opened this issue Nov 7, 2023 · 0 comments
Open
3 of 4 tasks

vf upgrade yields error when virtual environment does not exist #239

ammgws opened this issue Nov 7, 2023 · 0 comments
Labels

Comments

@ammgws
Copy link
Contributor

ammgws commented Nov 7, 2023

  • I am using Fish shell version 3.1 or higher.

  • I am using Python version 3.6 or higher.

  • I have searched the issues (including closed ones) and believe that this is not a duplicate.

  • If related to a plugin, I prefixed the issue title with the name of the plugin.

  • OS version and name: Arch Linux

  • Fish shell version: 3.6.1

  • VirtualFish version: 2.5.5

Issue

>vf upgrade doesnotexist
doesnotexist is broken. Rebuilding…
fish: Unknown command: /home/ammgws/.local/share/virtualenvs/doesnotexist/bin/python
in command substitution
	called on line 603 of file /usr/lib/python3.11/site-packages/virtualfish/virtual.fish
in function '__vf_upgrade' with arguments 'doesnotexist'
	called on line 1 of file /usr/lib/python3.11/site-packages/virtualfish/virtual.fish
in function 'vf' with arguments 'upgrade doesnotexist'
/usr/lib/python3.11/site-packages/virtualfish/virtual.fish (line 603): Unknown command
            set -l old_py_fv ($venv_path/bin/python -V | string split " ")[2]
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in function '__vf_upgrade' with arguments 'doesnotexist'
	called on line 1 of file /usr/lib/python3.11/site-packages/virtualfish/virtual.fish
in function 'vf' with arguments 'upgrade doesnotexist'
Argument is not a number: '.'
/usr/lib/python3.11/site-packages/virtualfish/virtual.fish (line 611): 
            if test "$old_py_mv" -ne "$new_py_mv"
               ^
in function '__vf_upgrade' with arguments 'doesnotexist'
	called on line 1 of file /usr/lib/python3.11/site-packages/virtualfish/virtual.fish
in function 'vf' with arguments 'upgrade doesnotexist'
Upgrading doesnotexist from  to 3.11.5
ln: failed to create symbolic link '/home/ammgws/.local/share/virtualenvs/doesnotexist/bin/python': No such file or directory
ln: failed to create symbolic link '/home/ammgws/.local/share/virtualenvs/doesnotexist/bin/python3': No such file or directory
ln: failed to create symbolic link '/home/ammgws/.local/share/virtualenvs/doesnotexist/bin/python3.11': No such file or directory
find: ‘/home/ammgws/.local/share/virtualenvs/doesnotexist’: No such file or directory
rm: missing operand
Try 'rm --help' for more information.

Expected behaviour

Check if valid venv and exit earlier. Especially since the vf upgrade --help text does say it's for existing venvs: "Purpose: Upgrades existing virtual environment(s)"

Perhaps add a check around here or in the following for loop:

set venv_list $argv

@ammgws ammgws added the bug label Nov 7, 2023
@justinmayer justinmayer changed the title vf ugprade XYZ does not check if XYZ actually exists before contuiuing vf upgrade yields error when virtual environment does not exist Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant