sentriz / fish-pipenv Goto Github PK
View Code? Open in Web Editor NEW๐๐ a fish plugin that automatically activates the pipenv subshell
Home Page: http://pipenv.org
License: MIT License
๐๐ a fish plugin that automatically activates the pipenv subshell
Home Page: http://pipenv.org
License: MIT License
Is there a way to automatically select the --fancy option for pipenv shell command? The reason is that it displays only one listing of the virtual environment name.
pipenv shell
(exams01-rcG8nKlv) ! ๎ฐ โฐยณ exams01-rcG8nKlv ๎ฐ ~/d/exams01 ๎ฐ ๎ โฆ ๎ฐ
pipenv shell --fancy
โฐยณ exams01-rcG8nKlv ๎ฐ ~/d/exams01 ๎ฐ ๎ โฆ ๎ฐ
poetry env info -p >/dev/null 2>&1 is slow, therefore, cd command become slow!
Need to search alternatives
I've just upgraded to the latest pipenv plugin for fish shell. Since the upgrade all pipenv commands prompt me with the following
Install http://docs.pipenv.org/en/latest/ to use this plugin.
I already have pipenv installed to the latest. The output of command -s pipenv
is /Users/napo/.pyenv/shims/pipenv
As it stands, I can't use pipenv.
If I open a new terminal, then cd into a directory with a Pipfile
, the virtualenv shell is launched, but in such a way that if I subsequently type exit
, my whole terminal exits, rather than just the virtualenv shell.
I installed this plugin with OMF omf install https://github.com/sentriz/fish-pipenv
but it doesn't load the virtual env when I cd into a repo with a Pipfile
. Does it work for you?
If I create a new terminal tab, it inherits the previous tabs location. If I do this in a pipenv folder, the original terminal gets the pipenv shell applied (from cd
ing into it), but the new tab opened directly in that folder doesn't.
I just installed fisher and pipenv (used fish without a plugin manager before), and when i open a shell and cd to any directory, it auto creates a virtualenv/Pipfile and load the subshell. It's only once per new shell, but it's not really an expected or desirable behavior
gabriel@gryphon:~> mkdir plop
gabriel@gryphon:~> cd plop
Creating a Pipfile for this project...
Creating a virtualenv for this project...
โ No virtualenv has been created for this project yet!
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/gabriel/.local/share/virtualenvs/plop-Fqtl0Bn_/bin/python2
Also creating executable in /home/gabriel/.local/share/virtualenvs/plop-Fqtl0Bn_/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Virtualenv location: /home/gabriel/.local/share/virtualenvs/plop-Fqtl0Bn_
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
Thanks for all the fish!
edit: i had virtualfish and auto_activation.fish, installed (without fisherman) i commented/moved them and i still get the behavior.
If I have pyenv-virtualenv hooks installed, then when I cd into a (sub)directory of a project, the virtualenv is automatically loaded. When I cd out of that project, the virtualenv is unloaded.
This plugin enables the activation behavior, but not yet the deactivation. Could the deactivation behavior be added?
Steps to reproduce:
cd project1
-> pipenv activated for project1cd ../project2
-> pipenv stays the sameWhat I expected:
cd ../project2
-> deactivate project1 pipenv and activate project2 pipenv.This plugin makes my shell's startup time much slower, from "imperceptible" to "~1 sec". Is there any way it could be loaded lazily?
For my flask apps, I've recently started using direnv
to load project specific environment settings via .envrc
files. I use the fish shell and have as such installed the pipenv plugin for integration with pipenv. However, when I cd into a pipenv created virtualenv containing a .envrc
, the fish pipenv plugin rightly activates the virtualenv environment but the .envrc
file is not sourced.
Therefore if I give the command flask run
for example, I get the warning
Usage: flask run [OPTIONS]
Error: Could not locate Flask application. You did not provide the FLASK_APP environment variable.
I therefore have to Ctrl+D
to exit the virtualenv, which then causes direnv
to source the .envrc
, after which I give the pipenv shell
command to activate the virtualenv again.
To save me from doing this every time, I've uninstalled the pipenv plugin for the moment.
$ fisher add sentriz/fish-pipenv
Installing 2 plugin/s
! Fetch add github.com/fisherman/add
OK Copy pipenv
! There was an error installing add or more plugin/s.
Try using a namespace before the plugin name: owner/add
This went wrong. What do I do?
if I just copy the __pipenv_shell_activate function into my config.fish it works just the same but will take ~1 second for a new fish shell to start. usual results from:
time fish
0.99 real 0.82 user 0.15 sys
versus ~.15 real when i just copy the function into config. I'm guessing this is more to do with fisherman or fish shell?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.