.gitignore for Python developers

If you are using Git for version control for your Python egg and buildout development below are is a sample which you might want to put into your .gitignore file.

*.mo
*.egg-info
*.egg
*.EGG
*.EGG-INFO
bin
build
develop-eggs
downloads
eggs
fake-eggs
parts
dist
.installed.cfg
.mr.developer.cfg
.hg
.bzr
.svn
*.pyc
*.pyo
*.tmp*

Suggestions for new ignores are welcome.

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

6 thoughts on “.gitignore for Python developers

  1. How about Jython class files (*.class, the equivalent of *.pyc)?

    And if any of the developers use Mac OS X, ignore the .DS_Store folders.

  2. I don’t know if it belongs here, but I usually also ignore
    *.LCK
    *.lck

    to avoid fallout from dreamweaver users with whom i may share my source tree. (Yup, web developer here)

  3. I have “dist” in addition, which gets created whenever you make a release. You also could ignore virtualenv things as well: “.Python include lib” and finally I have “local.cfg” in my list.

  4. If you are using coverage.py to measure code coverage, then you’ll also want to ignore:

    .coverage

    and probably:

    htmlcov

    If you are building C extensions, then add:

    *.pyd *.so

Leave a Reply

Your email address will not be published. Required fields are marked *