-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
guidance on how to use pipenv with ansible #363
Comments
|
Yeah, that I use. More in general I am a bit puzzled by what exactly determines which virtual environment is activated (part of that might be that I am not using pew so far). In my local setup it is the folder in which I run 'pipenv shell'. For ansible then is this the way to go e.g.?:
|
Hey @musicformellons, the environment selected by You can also perform the |
Actually the above ansible task works! So that's cool. The definition of 'project' is then probably a folder with Pipfile in it. My question now is: What is the best way to start a project, i.e. create a Pipfile? As I noticed that when I want to start a new project with 'pipenv install --three' it will create a new Pipfile only when it does not find an existing one closer to the root of the folder tree. As I already had a Pipfile closer at the root, it 'interferes' creating a new one... So you have to do it 'manually' then? I noticed that you can set how deep pipenv looks for a Pipfile. So I set it to 1 folder deep, this works for me, but I am still curious as to what is 'best practice'. |
@musicformellons, you're correct, by default pipenv treats a directory containing a Pipfile and all directories up to three levels deep as a "Project". This can be modified by the environment variable that you noted to better fit your needs.
It sounds like what you're doing is pretty well thought out and in line with how we'd expect people to be doing. Let us know if you have any further questions, thanks! |
Alright, I'm going to close this out, but let us know if there's more clarification needed. Thanks again for checking in @musicformellons! |
Something that I was experimenting that seems to work is:
Where Ansible knows not to run the |
Oh, that wasn't quite right, since people check in the
I'll stop with the noise now :) |
I am trying to setup a server with ansible and use pipenv. I succeed in creating the virtual environment, but could you give examples of how to activate the environment and then run commands in it?
The text was updated successfully, but these errors were encountered: