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

Added extensions for virtual environments in .gitignore #2372

Merged
merged 8 commits into from
Aug 28, 2024

Conversation

varuntotakura
Copy link
Contributor

@varuntotakura varuntotakura commented Aug 24, 2024

Description

.gitigore doesn't have anything about environments in its extensions.

When we try to use a virtual environment to run the whole package locally, if we try to add the files to the repository, the environment files are also being added.

To fix that I have included extensions of the virtual environments

Checklist

  • Follows official PR format
  • New features are properly documented (with an example if appropriate)
  • Changes are listed in changelog

📚 Documentation preview 📚: https://arviz--2372.org.readthedocs.build/en/2372/

Copy link

codecov bot commented Aug 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.01%. Comparing base (8795992) to head (90c4e75).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2372   +/-   ##
=======================================
  Coverage   87.01%   87.01%           
=======================================
  Files         124      124           
  Lines       12788    12788           
=======================================
  Hits        11128    11128           
  Misses       1660     1660           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +32 to 38
.env
.venv
env/
venv/
ENV/

# PyInstaller
Copy link
Contributor

Choose a reason for hiding this comment

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

Other options that come to my mind are

  • hatch.toml
  • pdm.lock
  • Pipfile.lock
  • Pipfile
  • poetry.lock`

I'm not completely sure if people should be building ArviZ following an approach different from the recommended one, but people can do whatever they want so it's probably good to have these files/directories listed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I believe it's important to use the recommended approaches. However, when installing dependencies, some may prefer to use a virtual environment. While it’s important to track the core dependency and configuration files like Pipfile, Pipfile.lock, poetry.lock, pdm.lock, and hatch.toml in version control, it’s equally important to ignore files and directories that are specific to individual developers' environments, such as virtual environments. These files are not relevant to other people's builds and can clutter the repository.

@amaloney
Copy link

If you're looking to

...ignore files and directories that are specific to individual developers' environments...

then you may want to add items you want git to ignore from your personal setup in the file .git/info/exclude. This way you can ignore what ever you want, and we would not have to keep track of the most recent flavor of things to ignore when building an environment in the .gitignore file.

I'm not opposed to the addition of the .env as this is typically where people will store credentials for an app they are using, and use something like python-dotenv to read those credentials, but the others are not necessary in my opinion. Especially when there are mechanisms for local ignores when using git, and you can cherry pick new/updated files via the command line without running a git add *, which can be dangerous if you have dotfiles with credentials stored in them.

@OriolAbril OriolAbril linked an issue Aug 28, 2024 that may be closed by this pull request
@OriolAbril OriolAbril changed the title Added extensions for virtual environments in .gitignore #2371 Added extensions for virtual environments in .gitignore Aug 28, 2024
@OriolAbril OriolAbril merged commit abcc7b4 into arviz-devs:main Aug 28, 2024
12 checks passed
@varuntotakura varuntotakura deleted the #2371 branch August 28, 2024 15:52
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.

gitignore doesn't have anything about virtual environments
4 participants