Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Ensure that the virtualenv dir is ignored from Git #1817

wants to merge 1 commit into from

Conversation

SanketDG
Copy link

@SanketDG SanketDG commented May 4, 2020

Fixes #1806

Thanks for contributing, make sure you address all the checklists (for details on how see

development documentation)!

  • ran the linter to address style issues (tox -e fix_lint)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix (need help)
  • added news fragment in docs/changelog folder
  • [] updated/extended the documentation

@SanketDG
Copy link
Author

SanketDG commented May 4, 2020

Question: Do we want this as a flag?

Copy link
Contributor

@gaborbernat gaborbernat left a 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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@gaborbernat gaborbernat May 4, 2020

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(
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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):
Copy link
Contributor

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

@gaborbernat
Copy link
Contributor

Superseded by #1825

@SanketDG SanketDG deleted the sanketdg/ensure-gitignore branch May 12, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate VCS ignores to avoid version controlling virtual environments
2 participants