git exclude files

178 views
Skip to first unread message

Gary Roach

unread,
Dec 11, 2015, 4:08:29 PM12/11/15
to django-users
Since Python3, venv seems to be preferable to virtualenv. Most of the
howto's are for virtualenv. The file setup between the two is completely
different. So do I include the bin/, include/, lib/, and the lib64 ->
/root/archive/lib files in the git repository or should they be
excluded. If the need to be excluded, how.

This is a Django 1.8, Python3.4 project, Debian 8 (jessie) project.

Gary R

Tim Graham

unread,
Dec 11, 2015, 5:51:01 PM12/11/15
to Django users, gary71...@verizon.net
I don't know of a use case where virtualenvs are stored in source control. I wouldn't recommend putting the virtual environment in your project folder either. If you use a tool like virtualenvwrapper [1] you can store all your virtualenvs in a single directory on your system to make managing them easy.

[1] https://virtualenvwrapper.readthedocs.org/

Gary Roach

unread,
Dec 12, 2015, 10:38:21 AM12/12/15
to django...@googlegroups.com
Unfortunately, venv doesn't give me a choice as to where the files are stored. They are all under the top directory of the same name as the project but are actually in the same directory as the top level project folder. ie /root/archive/ venv files, and archive/ project. From what you say, they should not be included in the git source control.

Gary R
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0aa43312-1070-4c21-94ca-4a39cd15096a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scot Hacker

unread,
Dec 12, 2015, 12:21:41 PM12/12/15
to Django users, gary71...@verizon.net
On Saturday, December 12, 2015 at 7:38:21 AM UTC-8, Gary Roach wrote:
Unfortunately, venv doesn't give me a choice as to where the files are stored. They are all under the top directory of the same name as the project but are actually in the same directory as the top level project folder. ie /root/archive/ venv files, and archive/ project. From what you say, they should not be included in the git source control.

I think the misunderstanding here is that you're thinking you should put your project code into the venv/virtualenv directory. That's not really how it's intended to be used. A typical setup might be:

~/virtualenvs/myproject
~/dev/myproject

When you activate myproject, the corresponding virtualenv is placed on your python path, so the libs it contains are available to you, and your pip installs end up there. But you do *your own* work in ~/dev/myproject. Complete separation of installed libs from your own project code. The question you're asking should never come up.

./s

 

graeme

unread,
Dec 13, 2015, 4:56:45 AM12/13/15
to Django users, gary71...@verizon.net


On Saturday, December 12, 2015 at 2:38:29 AM UTC+5:30, Gary Roach wrote:
/root/archive/lib files in the git repository or should they be
excluded. If the need to be excluded, how.

Definitely exclude it. There are lots of things that may make it break on a different system.

As another reply pointed out your code and the virtualenv or venv should be in different directories, so you should not need to exclude anything.

Gary Roach

unread,
Dec 13, 2015, 11:17:15 AM12/13/15
to django...@googlegroups.com
As I mentioned earlier, venv and virtualenv do not work the same. There may be a way to force venv to  put the files in a different place but the default is to put them in the directory just above the start of the project not in a separate .virtualenv file. So a different directory is not an option.

Gary R.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

Scot Hacker

unread,
Dec 13, 2015, 12:50:44 PM12/13/15
to Django users, gary71...@verizon.net
On Sunday, December 13, 2015 at 8:17:15 AM UTC-8, Gary Roach wrote:
As I mentioned earlier, venv and virtualenv do not work the same. There may be a way to force venv to  put the files in a different place but the default is to put them in the directory just above the start of the project not in a separate .virtualenv file. So a different directory is not an option.

The venv docs say that the process of creating a new virtual environment is just:

pyvenv /path/to/new/virtual/environment


It's not a matter of "forcing" the creation of the environment dir somewhere. If you are intentionally putting your project code in the same dir tree with the environment, you have a recipe for chaos. Again, there should be no need to .git exclude anything. 


./s


Gary Roach

unread,
Dec 13, 2015, 7:06:50 PM12/13/15
to django...@googlegroups.com
Sorry Scott but don't think that venv and pyvenv are the same. I use venv. There may very well be a way to do as you say but I'm down the road a bit at this point and really don't want to start screwing around with my whole project structure. I just need to exclude the aforementioned files and be done with it. It may not be pretty but I think I will avoid a lot of headaches by not messing with my present environmental structure.

Gary R.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages