David542
David542

Reputation: 110502

Virtualenv in source control

Perhaps this is more an opinion-based question, but I was wondering whether the contents of a virtualenv should be included in a GitHub repository. Why should it or should it not be included?

Upvotes: 5

Views: 1105

Answers (1)

Leon
Leon

Reputation: 12491

No, anything that can be generated should not be included.

Dependencies should be managed with something like pip, and the requirements.txt file can be included.

The only files under source control should be files you absolutely need to get you development environment going. So it can included boot strapping of some sort, ie, you can script the creation of the virtual environment, and that would be the first thing you run once you have cloned.

Also consider that your virtual environment contain binary files. You absolutely do not want those in your repository.

As pointed out by @JeremyBank below, your virtual environment can also differ from system to system meaning that your virtual environment will not be portable.

Upvotes: 8

Related Questions