<div dir="ltr">Hi Nick,<div><br></div><div>Just thinking some more about the scenario where Django defines a "comments" extra.<div><br></div><div>Say in our setup.py we have install_requires=['django[comments] >= 1.4']. What happens when this setup.py is run with Django 1.4 already installed? Is the (missing) extra just ignored, or will Django be upgraded to a version which declares the extra?</div><div><br></div><div>(anyone following along, please see my response to Nick below - forgot to reply all)</div><div><br></div><div>Cheers</div><div>Alex</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 22, 2015 at 2:04 PM, Alexander Hill <span dir="ltr"><<a href="mailto:alex@hill.net.au" target="_blank">alex@hill.net.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for your feedback Nick.<div><br></div><div>Just checking my understanding: say default extras existed and we'd implemented them as described, and I'm a Mezzanine user running Django 1.4. I see a new version has been released, don't read the release notes thoroughly, and run pip install --upgrade mezzanine as usual instead of specifying [-comments]. This would still install django-contrib-comments and upgrade Django in the process, is that right?</div><div><br></div><div>Seems like the cleanest way to do this would be for Django itself to define a "comments" extra, requiring django-contrib-comments, in Django 1.8's setup.py.</div><div><br></div><div>Cheers,</div><div>Alex</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 22, 2015 at 1:29 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 21 January 2015 at 16:13, Alexander Hill <<a href="mailto:alex@hill.net.au" target="_blank">alex@hill.net.au</a>> wrote:<br>
> Hi all,<br>
><br>
> I have run into a bit of a head-scratcher.<br>
><br>
> Prior to the upcoming version 1.8, Django included a comments app at<br>
> django.contrib.comments. As of 1.8, the app has been broken out into an<br>
> independent package, django-contrib-comments [1]. django-contrib-comments<br>
> requires Django >= 1.5.<br>
><br>
> The project I'm working on (Mezzanine) requires Django comments. I want<br>
> Mezzanine to support Django 1.4 through to 1.8, so I need<br>
> django-contrib-comments. But because it requires Django >= 1.5, when it's in<br>
> my dependencies Django gets automatically upgraded if version 1.4 is<br>
> installed, so the Mezzanine test suite isn't actually run under 1.4 [2].<br>
><br>
> Is there some way to only depend on django-contrib-comments if a minimum<br>
> version of Django is installed? Or any other way around this problem? Any<br>
> advice greatly appreciated!<br>
<br>
</span>The closest I can think of is to make the comments support an extra,<br>
so you'd need to specify "mezzanine[comments]" to get<br>
django-contrib-comments on 1.5+. That's unlikely to be acceptable in<br>
this case though, since existing dependencies on mezzanine would fail<br>
to install the comments support.<br>
<br>
While it won't help you right now, I did have an idea for a possible<br>
way to deal with this in PEP 426: provide a way to specify a set of<br>
"default extras" for a project. Those dependencies would still be<br>
installed by default, but you'd have an easy way to turn them off if<br>
you didn't want them.<br>
<br>
Then, in this case, you'd be able to run the Django 1.4 tests using<br>
"mezzanine[-comments]" rather than a default install to avoid<br>
attempting to install django-contrib-comments.<br>
<br>
Filed as: <a href="https://github.com/pypa/interoperability-peps/issues/18" target="_blank">https://github.com/pypa/interoperability-peps/issues/18</a><br>
<br>
Regards,<br>
Nick.<br>
<span><font color="#888888"><br>
--<br>
Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>