On 22 Jul 2013 19:12, "Vinay Sajip" <vinay_sajip@yahoo.co.uk> wrote:
>
> Nick Coghlan <ncoghlan <at> gmail.com> writes:
>
> > On 22 Jul 2013 01:46, "PJ Eby" <pje <at> telecommunity.com> wrote:
>
> > > To put it another way, it's not "exported only if extra is available",
> > > it's "exported, but make sure you have this first." A subtle
> > > difference, but important to the original use cases (see below).
> > Ah, yes, I see the distinction (and it does make this notion conceptually
> simpler).
>
> Does "make sure you have this first" mean "install this if it's not present"
> or "raise an exception if it's not present"? AFAICT PEP 376 does not
> consider extras at all, and so does not have any standard way to store which
> extras a distribution was installed with. So what's the standard way of
> testing if "extra is available"?
Check if all the dependencies associated with that extra are present. That was my observation earlier: since extras aren't really a thing in their own right (they're just a shorthand for referring to an additional set of dependencies) allowing script wrapper generation to depend on an extra is likely a bad idea, since it may lead to a partially installed package.
Since the check in pkg_resources is callback based, it's really up to the application looking for entry points to decide what unmet dependencies mean.
Cheers,
Nick.
>
> Regards,
>
> Vinay Sajip
>
> _______________________________________________
> Distutils-SIG maillist - Distutils-SIG@python.org
> http://mail.python.org/mailman/listinfo/distutils-sig