Contact Us

If you are interested in our services leave your contact details below and our sales representatives will contact you.

The organization which you represent
Email address we will use to contact you
Longer contact form…
 
  • About

    mFabrik Blog is about mobile and web software development, open source and Linux. We tell exciting tales where business, technology, web and mobile convergence.

    Creative Commons License
    This work is licensed under a Creative Commons Attribution 3.0 Unported License.

.gitignore for Python developers

Posted on July 23, 2010  by Mikko Ohtamaa
Filed Under git, plone, python, technology, web development, zope

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.

Read our blog  Subscribe mFabrik blog in a reader Follow us on Twitter Mikko Ohtamaa on LinkedIn

 

Other posts by Mikko Ohtamaa

 

Comments

6 Responses to “.gitignore for Python developers”

  1. Peter on July 23rd, 2010 12:59 pm
    Gravatar

    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. Maurits van Rees on July 23rd, 2010 1:23 pm
    Gravatar

    For emacs users:
    *~
    And perhaps:
    *.bak

     
  3. Maurits van Rees on July 23rd, 2010 1:26 pm
    Gravatar

    Oh, and since you are ignoring .bzr and .hg, you will want to ignore their ignore files as well, so:
    .bzrignore
    .hgignore

     
  4. Dan MacKinlay on July 23rd, 2010 3:04 pm
    Gravatar

    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)

     
  5. Hanno Schlichting on July 23rd, 2010 3:11 pm
    Gravatar

    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.

     
  6. Ned on July 23rd, 2010 3:40 pm
    Gravatar

    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