• 
      

    Extension dependencies automatically enable, and the Extension Manager informs the user that this will happen.

    Review Request #1590 — Created May 14, 2010 and discarded

    Information

    Djblets
    extensions

    Reviewers

    The extensions manager UI now reports what extension dependencies will be automatically enabled when a particular extension is enabled.  Extensions know about their dependencies through their setup.py's install_requires setting.
    Manual.
    david
    1. One trivial note
    2. Add an extra blank line here, please.
    3. 
        
    david
    1. Oh, one more comment:
    2. Indent should be 4 spaces.
    3. 
        
    mike_conley
    david
    1. One more thing that I just noticed.
    2. djblets/extensions/templatetags/djblets_extensions.py (Diff revision 2)
       
       
       
       
       
       
       
      Looking at this a little more carefully, I think this could me more efficient:
      
      if extension.info.requires:
          return nodelist.render(context)
      return ""
      
      
      That way, we avoid using len() when all we care about is non-empty, and in the fallback case we don't render the nodelist.
    3. 
        
    mike_conley
    chipx86
    1. Just realized that the extension enabling one is based on this. You may want to use the --parent flag to post-review to specify the parent branches so that it's easier to review changes based on uncommitted changes.
      1. Er...that was just me playing with the setup.py params to ensure I had a nice developer egg-link setup.  Wasn't supposed to see the light of day.  
        
        ...
        
        :D
    2. 
        
    mike_conley
    Review request changed
    Change Summary:
    I've decided to combine this review request with the one I filed here:  http://reviews.reviewboard.org/r/1591/ (which did the enabling bit)
    
    Instead of dealing with pkg_resources Requirement objects, developers must provide a "requires" list of extension_id's in their Extension to indicate that it relies upon another extension.
    
    Other goodies:
    -ExtensionManager populates ExtensionInfo.requirements as a list of required Extension classes
    -In the UI, only required extensions that are disabled are reported to the user.  So, if B relies on A, and A is already enabled, B will not report that it will automatically enable A.
    
    Summary:
    Extension manager UI now reports dependencies that will be automatically enabled
    Extension dependencies automatically enable, and the Extension Manager informs the user that this will happen.
    mike_conley
    1. 
        
    2. djblets/extensions/base.py (Diff revision 4)
       
       
       
       
       
      I wasn't sure if this was the right place to do this.  I suppose I just didn't want to have to go through another loop.
    3. djblets/extensions/base.py (Diff revision 4)
       
       
      From feedback on:  http://reviews.reviewboard.org/r/1591/
    4. djblets/extensions/base.py (Diff revision 4)
       
       
       
      From feedback on: http://reviews.reviewboard.org/r/1591/
    5.