• 
      

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

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

    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.