<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In general, requirements.txt seems to be an<br>
anti-pattern. You either have to use likely to break tooling or you'll<br>
have to reinvent that from scratch. You're better off putting it<br>
directly in setup.py and using setup.py to install dependencies in a<br>
virtualenv instead of requirements.txt<br></blockquote><div><br></div><div>I don't know your context for calling it an anti-pattern, but there are valid use cases for requirements.txt vs install_requires.<br></div><div>here's what the "Python Packaging User Guide" has on the distinction<br><br><a href="https://packaging.python.org/en/latest/requirements.html">https://packaging.python.org/en/latest/requirements.html</a><br><br></div><div>skipping to the distinctions, it lists four:<br><p>Whereas <tt class=""><span class="">install_requires</span></tt> defines the dependencies for a single project,
<a class="" href="https://pip.pypa.io/en/latest/user_guide.html#requirements-files" title="(in pip v6.0)"><em class="">Requirements Files</em></a> are often used to define
the requirements for a complete python environment.</p>Whereas <tt class=""><span class="">install_requires</span></tt> requirements are minimal, requirements files
often contain an exhaustive listing of pinned versions for the purpose of
achieving <a class="" href="https://pip.pypa.io/en/latest/user_guide.html#repeatability" title="(in pip v6.0)"><em class="">repeatable installations</em></a> of a complete
environment.
<p>Whereas <tt class=""><span class="">install_requires</span></tt> requirements are “Abstract”, requirements files
often contain pip options like <tt class=""><span class="">--index-url</span></tt> or <tt class=""><span class="">--find-links</span></tt> to make
requirements “Concrete”. <a class="" href="https://packaging.python.org/en/latest/requirements.html#id4" id="id3">[1]</a></p>
<p>Whereas <tt class=""><span class="">install_requires</span></tt> metadata is automatically analyzed by pip during an
install, requirements files are not, and only are used when a user specifically
installs them using <tt class=""><span class="">pip</span> <span class="">install</span> <span class="">-r</span></tt>.</p><br></div></div><br></div></div>