-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that the virtualenv dir is ignored from Git #1817
Conversation
Question: Do we want this as a flag? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add test 👍
@@ -154,6 +154,15 @@ def run(self): | |||
safe_delete(self.dest) | |||
self.create() | |||
self.set_pyenv_cfg() | |||
self._ensure_gitignore() | |||
|
|||
def _ensure_gitignore(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought this needs to be within https://github.com/pypa/virtualenv/blob/master/src/virtualenv/create/via_global_ref/api.py#L89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yeah please add an option to select and extend this similar to how we do with activators.
""" | ||
Ignore the virtualenv directory from git. | ||
""" | ||
self.dest.joinpath(".gitignore").write_text( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the /
instead of join path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the utf-8 encoding is not needed can leave it empty to use platform default;
the comment is not needed, please remove
@@ -0,0 +1 @@ | |||
Ensure that the virtualenv dir created is ignored by Git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not follow the example structure, e.g. missing user
@@ -154,6 +154,15 @@ def run(self): | |||
safe_delete(self.dest) | |||
self.create() | |||
self.set_pyenv_cfg() | |||
self._ensure_gitignore() | |||
|
|||
def _ensure_gitignore(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not make it git specific, let's cover all VCS covered here https://www.python.org/dev/peps/pep-0610/#registered-vcs
a better name is: generate_vcs_ignore
, no need to make it private
Superseded by #1825 |
Fixes #1806
Thanks for contributing, make sure you address all the checklists (for details on how see
development documentation)!
tox -e fix_lint
)docs/changelog
folder