-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Support .project files in virtualenvs if they are available #134
base: main
Are you sure you want to change the base?
Conversation
While for me the jury is still out regarding the viability of this endeavor, I understand your desire to support your personal work-flow. Any such attempt, however, should probably occur within the context of the relevant plugin and not in |
Do I get this right? You would take the pull request if it is implemented inside the projects plugin, instead of in the global activate function? |
@justinmayer Please clarify - so I know it is worth putting more work into this. |
I am open-minded about it, provided the implementation does not cause problems for existing behaviors. That said, the final decision lies with @adambrenecki and is not mine to make. |
@adambrenecki how do you feel about this? I'd like to get the fish version to be feature compatible with virtualenvwrapper to make it as easy as possible to switch. |
Yep, I'd prefer this to be part of the projects plugin, I think. The way I see it, the I'm also open to hearing the argument for |
Adam Brenecki wrote:
> I'm also open to hearing the argument for vf activate automatically cding like vf workon does now
Personally, I like that I have a way of activating a virtual environment without any directory switching. I often find myself in the right directory but just need to activate a particular virtual environment, but one that is usually associated with a different project. So the current “vf activate” behavior is quite handy for those situations. Otherwise one has to activate and then manually switch back to where they were before the auto-cd happened.
Just my two cents. 😁
|
@justinmayer: I actually use |
I have updated this pull request with a tentative implementation for a more complete
I'm not entirely happy with the implementation yet, but that is also in large parts because I don't know fish very well and am surely doing stuff the wrong way. So any advice is much appreciated. Some closing thoughts: It could be interesting to go for a more complete embrace of the way |
@justinmayer + @adambrenecki Any input? |
Hi Martin. My schedule is completely booked at the moment, so I may not be able to adequately review this pull request for a while. I'll do my best to have a look when the dust settles. That said, I will take a moment to comment regarding compatibility with |
Just my 2 cents regarding this issue. I am switching from virtualenwrapper to vf and I am not interested in using the But the ability to optionally define a project path and automatically switch to that folder is pretty a nice feature. I use this in some of my virtualenvs but not all... This feature wont change behaviour if your virtualenv was create by vf because the |
For those interested waiting for a resolution on this issue. It can be achieved with a function that watches
|
I have a similar workflow, or rather I like to arrange projects into subdirectories according to category / tag (e.g work, experiments, github, etc...) and not having the ability to change the home dir makes things difficult. I rebased this PR over latest master and tested it, it works well for me. Cannot push to PR as I'm not a maintainer, but my rebased for is here if needed: asfaltboy/virtualfish#dwt-master |
I have since not switched to virtual fish, so I'm not using this yet (also because of the problems) but my thinking is now, that it may be best to just store to .project all the time and use that as the default storage instead of an additional one. That removes custom arguments and makes the implementation smoother. (just needs an initializer logic for virtualenvs that are missing that file. |
Hi folks. I appreciate the work Martin has put into this, and clearly there are people who want to use So I took a stab at a minimal implementation, also adding some error-checking in case folks put a non-existent directory into the This would allow users to begin using What do you think? |
I really like this. It makes the About creating .project files:
|
@dwt: Glad to hear it. I added this via PR #149, including your fix for project completions when My initial impression is that the less-intrusive option is probably the best way forward for now. In fact, I wonder whether it is just as easy for users (and certainly easier for us) to put the |
Seems to work fine for me |
Great. Initial support for .project files is now in master. 🎊 |
This initial support for If @dwt or anyone else would like to propose follow-up enhancements, would you please suggest here what those might be, so we can determine the next course of action? |
Great to hear. I'm currently quite deeply involved in building anonymous and privacy preserving bluetooth tracing applications to fight covid19 - but I'll get back here as soon as I get a little bit downtime. |
That is certainly a more important endeavor in these troubled times. Glad to hear you are working on something that will hopefully make a difference. Looking forward to your return after some calm has been restored. |
I usually would open a new issue, but because you invite suggestions here: I would love auto-deactivation of the virtualenv when I cd out of the project directory - just like the auto-activation plugin does when I cd out of a directory containing a In any case, thank so much for this great work! |
@cecep2: Thank you for the kind words. I wrote the Projects plugin, but I don't use the auto-activation plugin and thus am ill-equipped to comment on how the two plugins might be combined to provide the functionality you mentioned. That said, I can't imagine it would be hugely difficult to enhance the Projects plugin to determine whether the auto-activation plugin has been loaded, and if so, de-activate the associated virtual environment upon leaving the project directory. Is this something you would be willing to help out with? If so, I would be happy to provide guidance to assist you in implementing this feature. |
I have to say, I'm using vf with projects support for quite some time now, and have gotten into the habit of creating the pwd > $VIRTUAL_ENV/.project That has quite stalled my energy to enhance this pull request. :/ But maybe this shortcut can be useful to other people in the meantime. |
Hi there,
since this is a feature of virtualenvwrapper that is quite important to me, I added support for it to virtual fish.
Would you please merge it?
Best of thanks!