Re: making it feasible to rely on loaders for reading intra-package data files
PJ Eby <[email protected]> Thu, 6 Feb 2014 12:15:10 -0500
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CALeMXf5o+VYbisAuampbLfV_yqaqMeEvDYhCCvHi6NR5E4DjAQ@mail.gmail.com> |
On Wed, Feb 5, 2014 at 5:58 PM, Nick Coghlan <[email protected]> wrote: > And in the context of Chandler as an integrated > application and there being no "default" version of packages already on > sys.path, pkg_resources.WorkingSet works fine - problems only arise because > Fedora *does* bless one version as default, puts it directly on sys.path, > and then the first pkg_resources import in an application locks all of those > default versions in as the expected versions if you don't arrange to set > __main__.__requires__ first, which then doesn't play well with entry point > based script wrappers Huh? Entry point script wrappers *set* __requires__ as the very first thing they do, followed by importing pkg_resources. (Alternatively, if you build the scripts using buildout, they have paths hardcoded. Either way, no problems with default versions.) The only way I can see problems is if you *aren't* using entry point wrappers for your scripts, *and* you want non-default versions. > So extracting just the resource API to add to pkgutil sounds like a good > idea to me, and should be a lot simpler than trying to tackle WorkingSet. Indeed.