Skip to content

Ignore the venv folder recursively

Tanvir Roshid requested to merge tanvir/ignore/venv/recursively into master

This MR looks at ignoring the venv folder by adding it to the .gitignore file. This is applied recursively, i.e., any folder at the root level and at a subdirectory level named venv, will be ignored by Git entirely.

The reasoning is that Buildstream 2.0 now supports installation through Pip. It is possible that developers have numerous virtual environments across various projects. Keeping the venv per project at the root level is not uncommon. Hence, it would be helpful if we ensured this folder is not tracked at all to avoid annoying scenarios involving the git add -A command.

This MR applies this recursively to make it clear that folders named venv will not be tracked. It does not make sense for developers to create subdirectories inside projects named venv, since it is a keyword across Python that refers to a virtual environment. The environment naming scheme is custom per developer. Thus, we cannot look at ignoring all possible combinations.

However, venv is typical, and we should at least support ignoring folders that have this name. There is no possible use-case that would justify creating a folder named venv, which serves a specific purpose. Whether this is at the root level or sub-directory level.

Fixes: #745

CC:

Edited by Tanvir Roshid

Merge request reports