Fix Python – Best practices for adding .gitignore file for Python projects? [closed]

Question

Asked By – ewall

I’m trying to collect some of my default settings, and one thing I realized I don’t have a standard for is .gitignore files. There’s a great thread showing a good .gitignore for Visual Studio projects, but I don’t see many recommendations for Python and related tools (PyGTK, Django).

So far, I have…

*.pyc
*.pyo

…for the compiled objects and…

build/
dist/

…for the setuptools output.

What are some best practices for .gitignore files, and where can I go for more about these best practices?

Now we will see solution for issue: Best practices for adding .gitignore file for Python projects? [closed]


Answer

When using buildout I have following in .gitignore (along with *.pyo and *.pyc):

.installed.cfg
bin
develop-eggs
dist
downloads
eggs
parts
src/*.egg-info
lib
lib64

Thanks to Jacob Kaplan-Moss

Also I tend to put .svn in since we use several SCM-s where I work.

This question is answered By – Davor Lucic

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0