# ============================================ # Python项目 .gitignore 文件 # 生成日期:2025-12-05 # ============================================ # 1. Python字节码和编译文件[1](@ref)[3](@ref)[6](@ref) __pycache__/ *.py[cod] *$py.class *.pyc *.pyo *.pyd # C扩展模块 *.so # 2. 分发和打包文件[1](@ref)[3](@ref)[6](@ref) .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller生成文件[1](@ref)[3](@ref) *.manifest *.spec # 安装日志 pip-log.txt pip-delete-this-directory.txt # 3. 单元测试和覆盖率报告[3](@ref)[6](@ref) htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ cover/ # 4. 翻译文件 *.mo *.pot # 5. 框架特定文件 # Django[3](@ref)[6](@ref) *.log local_settings.py db.sqlite3 db.sqlite3-journal */migrations/*.py !*/migrations/__init__.py # Flask[1](@ref)[3](@ref) instance/ .webassets-cache # Scrapy .scrapy # Sphinx文档 docs/_build/ # PyBuilder .pybuilder/ target/ # 6. Jupyter Notebook和IPython[3](@ref)[6](@ref) .ipynb_checkpoints profile_default/ ipython_config.py # 7. 环境管理文件 # pyenv版本文件[3](@ref)[6](@ref) # .python-version # pipenv(根据项目需要决定是否忽略)[3](@ref)[6](@ref) #Pipfile.lock # poetry(根据项目需要决定是否忽略)[3](@ref)[6](@ref) #poetry.lock # pdm[6](@ref) #pdm.lock .pdm.toml # PEP 582包目录[3](@ref)[6](@ref) __pypackages__/ # Celery相关文件[3](@ref)[6](@ref) celerybeat-schedule celerybeat.pid # SageMath解析文件 *.sage.py # 8. 虚拟环境和环境变量文件[1](@ref)[3](@ref)[5](@ref) .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # 9. IDE和编辑器配置文件[4](@ref)[5](@ref) # PyCharm/IntelliJ IDEA .idea/ # VS Code .vscode/ *.vscode/settings.json *.code-workspace # Spyder项目设置 .spyderproject .spyproject # Rope项目设置 .ropeproject # 10. 文档生成 # mkdocs文档 /site # 11. 类型检查工具缓存[3](@ref)[6](@ref) .mypy_cache/ .dmypy.json dmypy.json # Pyre类型检查器 .pyre/ # pytype静态类型分析器 .pytype/ # Cython调试符号 cython_debug/ # 12. 操作系统特定文件(macOS)[2](@ref)[4](@ref) .DS_Store .AppleDouble .LSOverride Icon ._* .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk # 13. 项目特定自定义忽略(根据实际情况添加) # 日志文件 *.log .*.log # 本地配置文件 local_config.py # 数据目录(如果需要) # datas/ # docker_image_build_tmp/ # logs/ # results/