Make Djblets package develop mode compatible with wheels and npm packages.
Review Request #8493 — Created Oct. 26, 2016 and submitted
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 invokespip install -e .
, which will perform
the equivalent ofsetup.py develop
but with Wheels. (Behind the
scenes, it actually usessetup.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 (noDjblets.egg-info
,node_modules
,dist
, orbuild
).Ran
./setup.py develop
. Saw that it upgradedsetuptools
andpip
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 |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
We are requiring pip, so I think it is safe to assume that setuptools exists on the machine. Can we … |
brennie | |
Docstring? |
david | |
Docstring? |
david | |
Docstring? |
david | |
Docstring? |
david | |
Docstring? |
david | |
Docstring? |
david | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
'pkg_resources' imported but unused |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot |
- Change Summary:
-
- Added docstrings.
- Added a
--no-npm
flag tosetup.py develop
.
- Commit:
-
634be0889ec1e085941d31756abcfd32aa3dcc4ef5a849a7dce0a0212223e04b93ea030bcc70af99
-
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
-
-
-
- Change Summary:
-
npm-cache
is now only used if passing--use-npm-cache
. - Description:
-
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 packagedependencies 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 dependenciesvia wheels. It does this by first ensuring we have a modern pip/setuptools, and then invokes pip install -e .
, which will performthe equivalent of setup.py develop
but with Wheels. (Behind thescenes, it actually uses setup.py develop
with shims to install thewheel 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 ~ (preferred npm-cache, if installed, to speed up installation). ~ (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. - Commit:
-
f5a849a7dce0a0212223e04b93ea030bcc70af9999c794b7d451a51dba693f7c617360a362c8ebc0
-
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
-
-
-
- Change Summary:
-
- Fixed media building due to a bad variable reference.
- Fixed building packages with wheels. (We got lucky in that we always built eggs before wheels.)
- Commit:
-
99c794b7d451a51dba693f7c617360a362c8ebc00645a30dbde21cfcbfd4835e9a4399dcd5e204f6
-
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
-
-
-
-
-