[New-bugs-announce] [issue39236] Adding a .gitignore file to virtual environments

Brett Cannon report at bugs.python.org
Mon Jan 6 14:45:05 EST 2020


New submission from Brett Cannon <brett at python.org>:

In a discussion on Twitter, the idea of having venv lay down a .gitignore file in a newly created virtual environment that consisted of nothing but `*` came up (https://twitter.com/codewithanthony/status/1213680829530099713). The purpose would be to help prevent people from inadvertently committing their venv to git. It seems pytest does something similar for .pytest_cache (got one complaint but have chosen to keep it otherwise).

To me this seems like a good enhancement. Since this would mostly benefit beginners then it should probably be an opt-out if we do it at all. Maybe make --no-ignore-file to opt out?

FYI Mercurial does not support subdirectory hgignore files like git does, so this may be git-specific (for now): https://www.selenic.com/mercurial/hgignore.5.html.

----------
components: Library (Lib)
messages: 359459
nosy: brett.cannon, vinay.sajip, xtreak
priority: low
severity: normal
status: open
title: Adding a .gitignore file to virtual environments
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39236>
_______________________________________


More information about the New-bugs-announce mailing list