<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div> </div>
<div> </div>
<div id="sig18283025"><div class="signature">-- <br></div>
<div class="signature"> Donald Stufft<br></div>
<div class="signature"> donald@stufft.io<br></div>
<div class="signature"> </div>
</div>
<div> </div>
<div> </div>
<div>On Sat, Feb 1, 2014, at 01:06 PM, Brett Cannon wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div> </div>
<div><div> </div>
<div> </div>
<div><div>On Sat, Feb 1, 2014 at 12:34 PM, Donald Stufft <span dir="ltr"><<a href="mailto:donald@stufft.io" target="_blank">donald@stufft.io</a>></span> wrote:<br></div>
<div> </div>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div><div><div>On Sat, Feb 1, 2014, at 12:26 PM, Brett Cannon wrote:<br></div>
<div> </div>
</div>
<blockquote type="cite"><div dir="ltr"><div> <br></div>
<div><div> <br></div>
<div> <br></div>
<div><div>On Sat, Feb 1, 2014 at 3:23 AM, Vinay Sajip <span dir="ltr"><<a href="mailto:vinay_sajip@yahoo.co.uk" target="_blank">vinay_sajip@yahoo.co.uk</a>></span> wrote:<br></div>
<div> <br></div>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Fri, 31/1/14, Brian Wickman <<a href="mailto:wickman@gmail.com" target="_blank">wickman@gmail.com</a>> wrote:<br></div>
<div> <br></div>
<div>
> There are myriad other practical reasons. Here are some:<br></div>
<div> <br></div>
<div>Thanks for taking the time to respond with the details - they are good data points<br></div>
<div>
to think about!<br></div>
<div> <br></div>
<div> <br></div>
<div>
> Lastly, there are social reasons. It's just hard to convince most engineers<br></div>
<div>
> to use things like pkg_resources or pkgutil to manipulate resources<br></div>
<div>
> when for them the status quo is just using __file__. Bizarrely the social<br></div>
<div>
> challenges are just as hard as the abovementioned technical challenges.<br></div>
<div> <br></div>
<div>I agree it's bizarre, but sadly it's not surprising. People get used to certain ways<br></div>
<div>
of doing things, and a certain kind of collective myopia develops when it<br></div>
<div>
comes to looking at different ways of doing things. Having worked with fairly<br></div>
<div>
diverse systems in my time, ISTM that sections of the Python community have<br></div>
<div>
this myopia too. For example, the Java hatred and PEP 8 zealotry that you see<br></div>
<div>
here and there.<br></div>
</blockquote><div> <br></div>
<div>PEP 302 tried to unify this with get_data() and set_data() on loaders, but prior to Python 3.3 you just didn't have any guarantee that __loader__ would even be set, let alone have a loader with those methods. Paul can tell me if my hunch is off, but I assume the dream was that people would do `__loader__.get_data('asset.txt')` instead of `os.path.join(os.path.dirname(__file__), 'asset.txt')` to read something bundled with your package. But as Brian has pointed out, people just have habits at this point of assuming unpacked files and working off of __file__.
<br></div>
<div> <br></div>
<div>I know Daniel has said he wanted some concept of a listdir() on loaders so that they could basically act as a virtual file system for packages, but it would also require locking down what relative vs. absolute paths meant in get_data/set_data (i.e. is it relative to the loader in the package or the package itself? My pref is the latter for the case of reused loaders) and really pushing people to use the loader APIs for reading intra-package "files".
<br></div>
</div>
</div>
</div>
</blockquote></div>
<div dir="ltr"><div><div><div> <br></div>
<div>There's also the problem when you need to give a file that you have packaged as part of your thing to an API that only accepts filenames. The standard ssl module is one of these that i've run into recently.<br></div>
</div>
</div>
</div>
</div>
</blockquote><div> </div>
<div>Yes, that is definitely a design flaw in the ssl module that should get remedied. Did you file a bug to add a new API (whether new function or new parameters) to accept a file-like object or string instead?<br></div>
<div> </div>
<div>-Brett<br></div>
</div>
</div>
</div>
</blockquote><div> </div>
<div>I don't recall if I did or not, I know there's one open for allowing in memory client side certs, no idea for a ca bundle.<br></div>
<div> <br></div>
<div>It's easy enough to work around of course, but it requires the author of a tool that uses that to expect to need to work around it, and many authors simply don't care to support zipped usage.<br></div>
<div> </div>
<blockquote type="cite"><div dir="ltr"><div><div><div> <br></div>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr"><div><div><div> <br></div>
</div>
</div>
</div>
<blockquote type="cite"><div><div dir="ltr"><div><div><div> <br></div>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div> <br></div>
<div>
One of the things that's puzzled me, for example, is why people think it's reasonable<br></div>
<div>
or even necessary to have copies of pip and setuptools in every virtual environment<br></div>
<div>
- often the same people who will tell you that your code isn't DRY enough! It's<br></div>
<div>
certainly not a technical requirement, yet one of the reasons why PEP 405 venvs<br></div>
<div>
aren't that popular is that pip and setuptools aren't automatically put in there. It's a<br></div>
<div>
social issue - it's been decided that rather than exploring a technical approach to<br></div>
<div>
addressing any issue with installing into venvs, it's better to bundle pip and setuptools<br></div>
<div>
with Python 3.4, since that will seemingly be easier for people to swallow :-)<br></div>
</blockquote><div> <br></div>
<div>I suspect it's also ignorance and differences in deployment strategies. Some people have such small deployments that hitting PyPI every time works, for others like Brian it can't be more than a cp w/ an unzip. Maybe the Packaging Users Guide could have a Recommended Deployment Strategies section or something. I doubt there are that many common needs beyond "pull from PyPI every time", "pull from your own wheel repo", "copy everything over in a single wheel/zip you unpack" so that people at least have a starting point to work from (especially if the instructions work on all platforms, i.e. no symlink discussions).
<br></div>
</div>
</div>
</div>
</div>
<div><div><u>_______________________________________________</u><br></div>
<div>Distutils-SIG maillist - <a href="mailto:Distutils-SIG@python.org" target="_blank">Distutils-SIG@python.org</a><br></div>
<div><a href="https://mail.python.org/mailman/listinfo/distutils-sig" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br></div>
</div>
</blockquote></div>
<div> </div>
<div>_______________________________________________<br></div>
<div>
Distutils-SIG maillist - <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br></div>
<div>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br></div>
<div> </div>
</blockquote></div>
<div> </div>
</div>
</div>
</blockquote></body>
</html>