Rui
Rui

Reputation: 3673

How to maintain a Python project made with venv in version control

As a Python3 newbie, I made use of venv to create a project, and the created project directory structure is like this:

The next step is to store this project into a version control system like git. As a Java programmer working on maven project, storing pom.xml to version control is enough. So I feel a bit unworthy to store all these subdirectories to the version control

Question: Should I store all these files into the Version Control? If not, which of them to store in version control?

Upvotes: 0

Views: 629

Answers (1)

David
David

Reputation: 120

To store them in .git is unnecessary, if someone wants to have the same environment as you for example, you just want to make sure that they get the same requirements.txt file (packages that were installed by Python packet manager pip)

The bottom line is that to throw virtual environment in the gitignore and just have requirements file which is generated by pip freeze >> requirements.txt (you can name whatever you want but it is a convention to name it requirements

Upvotes: 1

Related Questions