From ae2006ccf114cbcda1e4b31358d26b75a3f1c897 Mon Sep 17 00:00:00 2001 From: Charlie Choiniere Date: Tue, 2 Feb 2016 20:56:48 -0500 Subject: [PATCH] Moved all dev dependencies into setup.py * Removed requirements-dev.txt * Added dependencies to setup.py using the extras_require option * Updated the documentation to use pip instead of setup.py develop * Updated .drone.yml to reflect updated installation --- .drone.yml | 3 +-- docs/contributing/developing.rst | 14 ++------------ requirements-dev.txt | 4 ++++ setup.py | 26 ++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index cd0cf4f5a..c47d31c66 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,8 +19,7 @@ build: image: python:3.5 commands: - XDG_CACHE_HOME=/drone/pip-cache pip install wheel - - XDG_CACHE_HOME=/drone/pip-cache pip install -r requirements-dev.txt - - XDG_CACHE_HOME=/drone/pip-cache pip install -e . + - XDG_CACHE_HOME=/drone/pip-cache pip install -e .[testing,docs] - python runtests.py cache: diff --git a/docs/contributing/developing.rst b/docs/contributing/developing.rst index 818bb9e8d..60ac07cce 100644 --- a/docs/contributing/developing.rst +++ b/docs/contributing/developing.rst @@ -22,11 +22,11 @@ Clone a copy of `the Wagtail codebase `_: git clone https://github.com/torchbox/wagtail.git cd wagtail -With your preferred virtualenv activated, install the Wagtail package in development mode: +With your preferred virtualenv activated, install the Wagtail package in development mode with the included testing and documentation dependencies: .. code-block:: sh - python setup.py develop + pip install -e .[testing,docs] Install the tool chain for building static assets: @@ -42,16 +42,6 @@ Compile the assets: Any Wagtail sites you start up in this virtualenv will now run against this development instance of Wagtail. We recommend using the `Wagtail demo site `_ as a basis for developing Wagtail. -Development dependencies -~~~~~~~~~~~~~~~~~~~~~~~~ - -Developing Wagtail requires additional Python modules for testing and documentation. - -The list of dependencies is in the Wagtail root directory in ``requirements-dev.txt`` and can be installed thus, from the Wagtail codebase root directory:: - - pip install -r requirements-dev.txt - - .. _testing: Testing diff --git a/requirements-dev.txt b/requirements-dev.txt index 64468d0ce..5e7b5eb20 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,7 @@ +# [RemovedInWagtail16Warning] +# DEPRECATED. Developer requirements should now be specified in setup.py +# in 'testing_extras' / 'documentation_extras'. + # Required for running the tests mock>=1.0.0 python-dateutil>=2.2 diff --git a/setup.py b/setup.py index 10de56dc6..992c8eedf 100755 --- a/setup.py +++ b/setup.py @@ -33,6 +33,28 @@ install_requires = [ "Willow>=0.2.2,<0.3", ] +# Testing dependencies +testing_extras = [ + # Required for running the tests + 'mock>=1.0.0', + 'python-dateutil>=2.2', + 'pytz>=2014.7', + 'Pillow>=2.7.0', + 'elasticsearch>=1.0.0', + + # For coverage and PEP8 linting + 'coverage>=3.7.0', + 'flake8>=2.2.0', +] + +# Documentation dependencies +documentation_extras = [ + 'Sphinx>=1.3.1', + 'sphinx-autobuild>=0.5.2', + 'sphinx_rtd_theme>=0.1.8', + 'sphinxcontrib-spelling==2.1.1', + 'pyenchant==1.6.6', +] setup( name='wagtail', @@ -64,6 +86,10 @@ setup( 'Topic :: Internet :: WWW/HTTP :: Site Management', ], install_requires=install_requires, + extras_require={ + 'testing': testing_extras, + 'docs': documentation_extras + }, entry_points=""" [console_scripts] wagtail=wagtail.bin.wagtail:main