Running virtualenv to set the ENV
cs at cskk.id.au
Thu Apr 25 00:08:52 EDT 2019
On 25Apr2019 12:05, Chris Angelico <rosuav at gmail.com> wrote:
>> Periodically I run "pip freeze >venv-requirements.txt"; this file is
>> revision controlled. That way I can rebuild an equivalent venv
>> somewhere else later.
>Any particular reason for this name? If not, I would generally
>recommend calling it "requirements.txt", as this is a minor
>convention. For instance, Heroku will recognize the presence of this
>file as an indication that this is a Python app, and will
>automatically "pip install -r requirements.txt" as part of deployment.
>Otherwise, I broadly agree with your directory structure (although I
>won't bother with a lib/python directory most of the time).
Both of these stem from not working only in Python. For example today
I've working on a project with a Python/PostgreSQL backend+cli, and a
The "venv-requirements.txt" makes it clear that it is for the venv
directory, and it also sorts nicely together in the directory listing.
The lib/python is an old habit, as my home directory has a lib/python
sitting beside my ossifying lib/perl. So I find the extra specificity
useful. And once I've made one or two convenience top level symlinks the
depth doesn't matter for interactive purposes.
Cameron Simpson <cs at cskk.id.au>
More information about the Python-list