<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 23, 2014 at 10:37 AM, Donald Stufft <span dir="ltr"><<a href="mailto:donald@stufft.io" target="_blank">donald@stufft.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><span style="color:rgb(34,34,34)">I’m going to attempt to read between the lines here a little bit.</span></div></div></div></blockquote><div><br></div><div>Thank you -- you did an excellent job of capturing the gestalt of my confusion !</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>The “egg” name is heavily overloaded in setuptools. It is used all over the place for varying sets of related but distinct concepts. The #egg= thing is one of those setuptools concepts where it used that name for something distinct but similar. Ideally it shouldn’t be #egg= or #wheel= but should be #dist= or something similar since it’s neither an egg or a Wheel and there is an open ticket in pip’s issue tracker to do that.</div></div></blockquote><div><br></div><div>OK, that clears it up. </div><div><br></div><div>Though I still get egg-info files all over the place -- not sure why that annoys me ;-) </div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>To make a clarification though, pip itself doesn’t depend on setuptools, it can install from Wheels without setuptools being installed on the system at all. It does however rely on setuptools to be installed if it is installing from a sdist. The reason for this is that pip uses setuptools as a build tool, so when it invokes a setup.py it’s “building" that distribution (even if it’s just pure python it needs “built”). However pip does some tricks so that it will always uses setuptools to build the project, regardless of if the project imports setuptools or distutils in their setup.py.</div></div></blockquote><div><br></div><div>Ah -- so pip needs to use setuptools to build, but a package doesn't have to explicitly use it in its setup.py.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>To that aim, install_requires specifies a packages dependencies as well as other metadata for that package, and requirements.txt is just a list of packages to install. The difference is subtle but a requirements.txt isn’t attached to a particular project and the rest of the metadata like name, version, etc.</div></div></blockquote><div><br></div><div>hmm...I agree, but often shipped alongside setup.py -- kind of like the fact that the name "setup.py" is a conventions rather than a spec, but expected all over the place.</div><div><br></div><div><br></div><div>On Tue, Dec 23, 2014 at 11:17 AM, Marcus Smith <span dir="ltr"><<a href="mailto:qwcode@gmail.com" target="_blank">qwcode@gmail.com</a>></span> wrote:<br></div><div><br></div><div><span class="im" style="font-size:13px"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">which I can now get with "pip --editable" or does that give me setuptools develop mode anyway</div></blockquote><div><br></div></span><div style="font-size:13px">"-e" uses setuptools develop mode.<br> </div></div><div style="font-size:13px">OK -- though it sounds like pip would do that whether or not I used setuptools in the setup.py.</div><div style="font-size:13px"><br></div><div style="font-size:13px"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">the main reason for setuptools is for "install_requires", which is fundamental to pip dependency resolution.<br>but in general, it offers more features and it's more maintained than pure distutils.<br>The standard advice is to use setuptools over distutils. </blockquote></div><div style="font-size:13px"><br></div><div style="font-size:13px">OK -- still not clear how install_requires plays with conda - but it's common enough that I think conda simply ignores it (though not silently)</div><div style="font-size:13px"><br></div><div style="font-size:13px"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The Packaging User Guide has a breakdown of install_requires vs requirements files.<br><a href="https://packaging.python.org/en/latest/technical.html#install-requires-vs-requirements-files" target="_blank">https://packaging.python.org/en/latest/technical.html#install-requires-vs-requirements-files</a></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>In brief, requirements files are usually for a whole "environment", whereas install_requires is for a project.<br></blockquote><div><br></div><div>A note about terminology here (both in this email and The Packaging User Guide) -- it seems to me that install_requires is about requirements for a "package" not a "project", and that, in fact, requirements.txt is best used for "projects".</div><div><br></div><div>I guess the distinction may be that a "package" has a setup.py, whereas a project is somethign you are building that requires perhaps a stack of unrelated packages. So you can say : if you want to run my application, run:</div><div><br></div><div>pip install -r requirements.txt</div><div><br></div><div>first.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">"install_requires" is critical when publishing projects to PyPI. </blockquote></div><div style="font-size:13px"><br></div><div style="font-size:13px">Good to know -- I may need to go there art some point.</div><div style="font-size:13px"><br></div><div style="font-size:13px">So I'll go with setuptools and install_requires, and see how it all goes.</div><div style="font-size:13px"><br></div><div style="font-size:13px">-Chris</div><div style="font-size:13px"><br></div><div style="font-size:13px"><br></div><div style="font-size:13px"><br></div></div>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R (206) 526-6959 voice<br>7600 Sand Point Way NE (206) 526-6329 fax<br>Seattle, WA 98115 (206) 526-6317 main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>