[Import-SIG] making it feasible to rely on loaders for reading intra-package data files
PJ Eby
pje at telecommunity.com
Thu Feb 6 18:15:10 CET 2014
On Wed, Feb 5, 2014 at 5:58 PM, Nick Coghlan <ncoghlan at gmail.com> 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.
More information about the Import-SIG
mailing list