Recommended .gitignore file for Python projects?
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…
…for the compiled objects and…
…for the setuptools output.
Any more recommendations for me?
5 Solutions collect form web for “Recommended .gitignore file for Python projects?”
When using buildout I have following in
.gitignore (along with
.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.
Github has a great boilerplate .gitignore
# Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] # C extensions *.so # Distribution / packaging bin/ build/ develop-eggs/ dist/ eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports .tox/ .coverage .cache nosetests.xml coverage.xml # Translations *.mo # Mr Developer .mr.developer.cfg .project .pydevproject # Rope .ropeproject # Django stuff: *.log *.pot # Sphinx documentation docs/_build/
local_settings.py, for django projects.
*~ for all projects.
One question is if you also want to use git for the deploment of your projects. If so you probably would like to exclude your local sqlite file from the repository, same probably applies to file uploads (mostly in your media folder). (I’m talking about django now, since your question is also tagged with django)
Here are some other files that may be left behind by setuptools: