[Tutor] About (dev-)requirements.txt
Albert-Jan Roskam
sjeik_appie at hotmail.com
Fri Mar 12 03:31:14 EST 2021
On 12 Mar 2021 01:28, Mats Wichmann <mats at wichmann.us> wrote:
On 3/11/21 2:30 PM, Alan Gauld via Tutor wrote:
> On 11/03/2021 14:37, Albert-Jan Roskam wrote:
>> How do I generate separate (i.e., disjoint) lists of requirements
for the
>> app itself and the dev-requirements?
>
> Ok, This one puzzles me.
> I come from a background of large projects, with typically
> between 50-500 developers. Requirements are something catalogued
> in a book
=====>>
Hi all,
@Alan: this is a nice page about
it https://blog.usejournal.com/why-and-how-to-make-a-requirements-txt-f329c685181e
I've read a bit more about this and I *may* have a solution (I haven't
tried it yet). It assumes a virtualenv is used. Let's say I use pandas in
my project and pandas itself has two dependencies, numpy and openpyxl.
pip freeze > constraints.txt
now move the *direct* dependencies (i.e. pandas) of the project in a file
requirements.txt so i looks like:
-c constraints.txt
pandas==1.0.0
Constraints.txt looks like:
numpy==1.0.0
openpyxl==1.0.0
Installation is simply
pip install -r requirements.txt
*If* any of the direct requirements need something in constraints.txt,
they are constrained to the given version.
Separating the "real" (=direct) requirements into dev and non-dev is now
relatively easy.
Although I also like DN's answer: why worry about it?
Best wishes,
Albert-Jan
More information about the Tutor
mailing list