• 
      

    Make Djblets package develop mode compatible with wheels and npm packages.

    Review Request #8493 — Created Oct. 26, 2016 and submitted

    Information

    Djblets
    release-0.10.x
    0645a30...

    Reviewers

    Djblets's packaging, and the world of Python packaging in general, has
    gotten increasingly complex with time. Wheels are the preferred (and
    better supported) format in the packaging world, and eggs are on their
    way out. We also require a handful of node.js modules for static media
    building.

    This change adds significant improvements to our packaging setup, in
    order to cover these issues and more.

    setup.py is now driven almost entirely by metadata within the package.
    It no longer lists dependencies, but rather makes use of a new
    djblets.dependencies module, which lists all the npm and Python package
    dependencies needed by Djblets. This allows for a couple of things.
    Primarily, it allows us to consolidate all dependencies/version ranges
    in one place. It also allows consumers of Djblets to refer to the same
    versions for their own uses.

    The setup.py develop command has been enhanced to install dependencies
    via wheels. It does this by first ensuring we have a modern
    pip/setuptools, and then invokes pip install -e ., which will perform
    the equivalent of setup.py develop but with Wheels. (Behind the
    scenes, it actually uses setup.py develop with shims to install the
    wheel versions, so it's otherwise fully compatible.)

    After that, it installs all the packages required for development (using
    dev-requirements.txt), and then installs required modules from npm
    (or npm-cache, if --use-npm-cache is installed).

    The end result is that contributors to Djblets now only need to run
    setup.py develop to have a fully working environment going.

    Set up a brand new virtual environment and started fresh in the Djblets
    source tree (no Djblets.egg-info, node_modules, dist, or build).

    Ran ./setup.py develop. Saw that it upgraded setuptools and pip
    and then installed the main package dependencies and development
    dependencies. Following that, it installed the node.js modules.

    Checked that all expected packages and files were installed. Successfully
    ran all unit tests.

    Description From Last Updated

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    We are requiring pip, so I think it is safe to assume that setuptools exists on the machine. Can we …

    brenniebrennie

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Docstring?

    daviddavid

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    'pkg_resources' imported but unused

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot

    Col: 1 E402 module level import not at top of file

    reviewbotreviewbot
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          djblets/dependencies.py
          setup.py
          djblets/__init__.py
          docs/djblets/conf.py
          docs/releasenotes/conf.py
      
      Ignored Files:
          package.json
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          djblets/dependencies.py
          setup.py
          djblets/__init__.py
          docs/djblets/conf.py
          docs/releasenotes/conf.py
      
      Ignored Files:
          package.json
      
      
    2. docs/djblets/conf.py (Diff revision 1)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    3. docs/djblets/conf.py (Diff revision 1)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    4. docs/releasenotes/conf.py (Diff revision 1)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    5. 
        
    david
    1. 
        
    2. setup.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    3. setup.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    4. setup.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    5. setup.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    6. setup.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    7. setup.py (Diff revision 1)
       
       
      Show all issues

      Docstring?

    8. 
        
    brennie
    1. 
        
    2. setup.py (Diff revision 1)
       
       
       
       
       
       
       
      Show all issues

      We are requiring pip, so I think it is safe to assume that setuptools exists on the machine. Can we just nuke this?

      1. I'll take care of this in a follow-up change.

    3. 
        
    chipx86
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          djblets/dependencies.py
          setup.py
          djblets/__init__.py
          docs/djblets/conf.py
          docs/releasenotes/conf.py
      
      Ignored Files:
          package.json
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          djblets/dependencies.py
          setup.py
          djblets/__init__.py
          docs/djblets/conf.py
          docs/releasenotes/conf.py
      
      Ignored Files:
          package.json
      
      
    2. docs/djblets/conf.py (Diff revision 2)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    3. docs/djblets/conf.py (Diff revision 2)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    4. docs/releasenotes/conf.py (Diff revision 2)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    5. 
        
    chipx86
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          djblets/dependencies.py
          setup.py
          djblets/__init__.py
          docs/djblets/conf.py
          docs/releasenotes/conf.py
      
      Ignored Files:
          package.json
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          djblets/dependencies.py
          setup.py
          djblets/__init__.py
          docs/djblets/conf.py
          docs/releasenotes/conf.py
      
      Ignored Files:
          package.json
      
      
    2. docs/djblets/conf.py (Diff revision 3)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    3. docs/djblets/conf.py (Diff revision 3)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    4. docs/releasenotes/conf.py (Diff revision 3)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    5. 
        
    chipx86
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          djblets/dependencies.py
          docs/releasenotes/conf.py
          docs/djblets/conf.py
          contrib/internal/build-media.py
          setup.py
          djblets/__init__.py
      
      Ignored Files:
          package.json
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          djblets/dependencies.py
          docs/releasenotes/conf.py
          docs/djblets/conf.py
          contrib/internal/build-media.py
          setup.py
          djblets/__init__.py
      
      Ignored Files:
          package.json
      
      
    2. contrib/internal/build-media.py (Diff revision 4)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    3. contrib/internal/build-media.py (Diff revision 4)
       
       
      Show all issues
       'pkg_resources' imported but unused
      
    4. docs/djblets/conf.py (Diff revision 4)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    5. docs/djblets/conf.py (Diff revision 4)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    6. docs/releasenotes/conf.py (Diff revision 4)
       
       
      Show all issues
      Col: 1
       E402 module level import not at top of file
      
    7. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-0.10.x (cd80e9b)