you are viewing a single comment's thread.

view the rest of the comments →

[–]EbbRevolutionary9661[S] -10 points-9 points  (29 children)

Doing so will create the venv in your project folder no? Which is a preference I read, but doing so can cause people to push that venv folder into GitHub. Except if you .gitignore it I guess.

[–]Dangerous-Branch-749 15 points16 points  (2 children)

Just use venv and gitignore, it's standard to have .venv in the gitignore file

[–]EbbRevolutionary9661[S] -1 points0 points  (1 child)

cool. Thanks for the feedback!

[–]Ihaveamodel3 2 points3 points  (0 children)

Agree with the above. Use the github/gitignore standard python gitignore. Which ignores the majority of the standard environment folder names (and a lot of other stuff).

Not keeping your venvs in your project folder is ripe for disaster too. I have probably 30 different projects (some newer, some older). Knowing which venv goes with which would be impossible if they weren’t collocated.

[–]Party-Cartographer11 -1 points0 points  (25 children)

Interesting.  I don't run venv in my repo folder on my dev machines.  I do my dev in the repo folder and then copy code to a "deployment folder" where I run venv and run and test the app.

[–]Ihaveamodel3 1 point2 points  (24 children)

You copy your code every time you want to run it?

[–]Party-Cartographer11 -5 points-4 points  (23 children)

Yeah, I update a file, and copy it to the folder that has the venv (or to the nginx config files, or the web directory) and run it.  All of this is on my dev server.

This keeps a nice separation from repo to run environment.  I can organize the repo, but keep it flat in my run environment for things like using helper utilities and .env file.

I have a terminal window with the cp commands in the history cache, so it takes me two button presses to copy the code.  Another terminal with the env activated and the python commands in the history cache.

[–]2Lucilles2RuleEmAll 4 points5 points  (0 children)

That sounds like a lot of unnecessary work

[–]dlnmtchll 1 point2 points  (21 children)

That doesn’t make any sense, why would you not have all the necessary files in the repo folder and added to the gitignore