<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 30, 2017, at 2:17 PM, Brett Cannon <<a href="mailto:brett@python.org" class="">brett@python.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Just to make sure I'm following this correctly, Donald is asking for:<div class=""><ul class=""><li class=""><font size="2" class="">A way for pip to ask back-ends what files should be in an sdist from a source checkout or to make an actual sdist</font></li><ul class=""><li class=""><font size="2" class="">Because sdists are a thing and so we should support them properly</font></li><li class=""><font size="2" class="">To make it so building wheels interact with just the files from an sdist instead of skipping that and going straight from a source checkout</font></li></ul><li class=""><font size="2" class="">Have this be a part of PEP 517 or at least a requirement for back-ends to support so it doesn't get left out</font></li></ul><div class=""><font size="2" class="">Am I missing anything?</font></div></div></div><br class=""></div></blockquote><br class=""></div><div><br class=""></div><div>More or less. If I had my druthers we’d just add another mandatory method to the API, something like:</div><div><br class=""></div><div>    def build_sdist_tree(sdist_directory, config_settings) -> None:</div><div>        …</div><div><br class=""></div><div>All this does is assemble the would be sdist tree into sdist_directory, handling any sdist creation time steps WITHOUT actually tar+gz’ing up this tree. My tests show that this is basically as fast as the copytree option in the simple case (which makes sense, that’s basically all it is) and is way faster than actually assembling the entire sdist tarball and all.</div><div><br class=""></div><div>To handle creation, we can either have ``twine sdist`` or something like that which just calls the above API and then runs ``shutil.make_archive()`` on the final directory.</div><div><br class=""></div><div>When building a wheel, pip can then just inside of this directory, call into the wheel metadata/wheel build API and ultimately install that wheel. It may even make sense for the build_wheel API to produce an “unpacked wheel” as well and again let something like ``twine wheel`` handle running ``shutil.make_archive()`` on it. Similar to the sdist case, this would further reduce the install time by avoiding the need to zip and then immediately unzip inside of pip.</div><div><br class=""></div><div>One unrelated thing I just noticed, I don’t think the PEP states how pip is supposed to communicate to this API what it’s actually building. Is it just assumed to be ``os.curdir()``? Ideally I think we’d add another parameter to all of these functions that is the directory containing the “input” to each of these.</div><div class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">—<br class="">Donald Stufft<br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>