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

Virtualenv name not correctly shown on Fish #1587

Closed
akx opened this issue Feb 12, 2020 · 5 comments
Closed

Virtualenv name not correctly shown on Fish #1587

akx opened this issue Feb 12, 2020 · 5 comments

Comments

@akx
Copy link

akx commented Feb 12, 2020

Activating a virtualenv on Fish only shows $VIRTUAL_ENV, not the venv's actual name. This wasn't an issue on Virtualenv 16.7.9.

Minimal reproducible example

~ $ cd (mktemp -d)
/v/f/n/8/T/tmp.23jTOhm3 $ python3 -m virtualenv foo
created virtual environment CPython3Posix(dest=/private/var/folders/n0/8r8c6bms2fj7753rvhmtybqm0000gn/T/tmp.23jTOhm3/foo, clear=False, global=False) with seeder FromAppData pip=latest setuptools=latest wheel=latest app_data_dir=/Users/akx/Library/Application Support/virtualenv/seed-v1 via=copy
/v/f/n/8/T/tmp.23jTOhm3 $ source foo/bin/activate.fish
($VIRTUAL_ENV) /v/f/n/8/T/tmp.23jTOhm3 $ # that should be "(foo)"
($VIRTUAL_ENV) /v/f/n/8/T/tmp.23jTOhm3 $

OS and pip list output

Package            Version
------------------ -------
appdirs            1.4.3
Click              7.0
distlib            0.3.0
filelock           3.0.12
importlib-metadata 1.5.0
pip                19.3.1
setuptools         45.2.0
six                1.14.0
virtualenv         20.0.2
wheel              0.34.2
zipp               2.2.0
  • macOS 10.15.3
  • Python 3.7.6 from Homebrew
  • Fish 3.0.2 from Homebrew
@txp314
Copy link
Contributor

txp314 commented Feb 12, 2020

Had the same issue today, you must edit the acitvate.fish file in your venv. Just put " instead of ' arround the $VIRTUAL_ENV in line 93. I send a pull request (#1594).

@gaborbernat
Copy link
Contributor

Hello, a fix for this issue has been released via virtualenv 20.0.2; see https://pypi.org/project/virtualenv/20.0.3/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-3-2020-02-12) . Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release.

thanks

@akx
Copy link
Author

akx commented Feb 12, 2020

@gaborbernat Thank you! I love the new venv creation speed! ⚡️

However, this problem still appears on 20.0.3 (whose version.py says it's 20.0.2):

$ python3 -m virtualenv --version
virtualenv 20.0.2 from /usr/local/lib/python3.7/site-packages/virtualenv/__init__.py
$ cat /usr/local/lib/python3.7/site-packages/virtualenv/version.py
""" Version information """
__version__ = "20.0.2"
$ python3 -m virtualenv hello
created virtual environment CPython3Posix(dest=/private/var/folders/n0/8r8c6bms2fj7753rvhmtybqm0000gn/T/tmp.SPaRmhu5/hello, clear=False, global=False) with seeder FromAppData pip=latest setuptools=latest wheel=latest app_data_dir=/Users/akx/Library/Application Support/virtualenv/seed-v1 via=copy
$ source hello/bin/activate.fish
($VIRTUAL_ENV) $  # still sad :(

Nuking (renaming) the seed-v1 folder didn't help either (as I figured it might have a cached fish activation template).

@gaborbernat
Copy link
Contributor

@akx you must still have virtualenv 20.0.2; I've checked the version.py is correct.

@akx
Copy link
Author

akx commented Feb 12, 2020

@akx you must still have virtualenv 20.0.2; I've checked the version.py is correct.

🤦‍♂ My bad, I didn't notice I ran the upgrade within a venv. That's what 10 hours at the office'll do to one...

Works as intended on 20.0.3! Thank you and sorry for the confusion.

/v/f/n/8/T/tmp.yqX9KBfc $ python3 -m virtualenv hello
created virtual environment in 232ms CPython3Posix(dest=/private/var/folders/n0/8r8c6bms2fj7753rvhmtybqm0000gn/T/tmp.yqX9KBfc/hello, clear=False, global=False) with seeder FromAppData pip=latest setuptools=latest wheel=latest app_data_dir=/Users/akx/Library/Application Support/virtualenv/seed-v1 via=copy
/v/f/n/8/T/tmp.yqX9KBfc $ source hello/bin/activate.fish
(hello) /v/f/n/8/T/tmp.yqX9KBfc $

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants