-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace virtual_env item with more general python item
- Loading branch information
1 parent
115a45f
commit 10a1fab
Showing
12 changed files
with
67 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function _tide_item_python | ||
if test -n "$VIRTUAL_ENV" | ||
python --version | string match -qr "(?<v>[\d.]+)" | ||
|
||
string match -qr "^.*/(?<dir>.*)/(?<base>.*)" $VIRTUAL_ENV | ||
# pipenv $VIRTUAL_ENV looks like /home/ilan/.local/share/virtualenvs/pipenv_project-EwRYuc3l | ||
# Detect whether we are using pipenv by looking for 'virtualenvs'. If so, remove the hash at the end. | ||
if test "$dir" = virtualenvs | ||
string match -qr "(?<base>.*)-.*" $base | ||
_tide_print_item python $tide_python_icon' ' "$v ($base)" | ||
else if contains -- "$base" virtualenv venv .venv env # avoid generic names | ||
_tide_print_item python $tide_python_icon' ' "$v ($dir)" | ||
else | ||
_tide_print_item python $tide_python_icon' ' "$v ($base)" | ||
end | ||
else if path is .python-version Pipfile __init__.py pyproject.toml requirements.txt setup.py | ||
python --version | string match -qr "(?<v>[\d.]+)" | ||
_tide_print_item python $tide_python_icon' ' $v | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# RUN: %fish %s | ||
_tide_parent_dirs | ||
|
||
function _python | ||
_tide_decolor (_tide_item_python) | ||
end | ||
|
||
set -lx tide_python_icon | ||
mock python --version "echo 'Python 3.11.5'" | ||
|
||
set -lx VIRTUAL_ENV | ||
_python # CHECK: | ||
|
||
set -lx VIRTUAL_ENV /home/ilan/python_project/non-generic-name | ||
_python # CHECK: 3.11.5 (non-generic-name) | ||
|
||
set -lx VIRTUAL_ENV /home/ilan/python_project/venv | ||
_python # CHECK: 3.11.5 (python_project) | ||
|
||
set -lx VIRTUAL_ENV /home/ilan/.local/share/virtualenvs/pipenv_project-EwRYuc3l | ||
_python # CHECK: 3.11.5 (pipenv_project) | ||
|
||
set -l python_directory (mktemp -d) | ||
cd $python_directory | ||
|
||
set -lx VIRTUAL_ENV | ||
echo >requirements.txt | ||
_python # CHECK: 3.11.5 |
This file was deleted.
Oops, something went wrong.