From 950a4448e329e9f85b657a3a8d0c0f434c458a01 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Tue, 18 Aug 2015 08:40:14 -0700 Subject: [PATCH] Move optional backend dependencies into setup.cfg [extras] The dogpile and mongo backends are optional so therefore the dependencies that are only used for those backends are optional. This makes use of the 'extras' capability in setuptools to declare those as optional dependencies if you're using those backends. If a consumer of oslo.cache wants to use the dogpile backend, for example, then they install oslo.cache like 'sudo pip install oslo.cache[dogpile]'. Note that the dogpile dependency is left in requirements.txt because the oslo_cache.core module has an unconditional import on that library. Change-Id: I28332964d568bda405fb8d1376d50db49d288b94 --- requirements.txt | 1 - setup.cfg | 6 ++++++ test-requirements.txt | 3 --- tox.ini | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2062d7b0..965e06e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,3 @@ oslo.config>=2.1.0 # Apache-2.0 oslo.i18n>=1.5.0 # Apache-2.0 oslo.log>=1.8.0 # Apache-2.0 oslo.utils>=2.0.0 # Apache-2.0 -python-memcached>=1.56 diff --git a/setup.cfg b/setup.cfg index 96218625..7ede0496 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,6 +28,12 @@ packages = oslo.config.opts = oslo.cache = oslo_cache._opts:list_opts +[extras] +dogpile = + python-memcached>=1.56 +mongo = + pymongo>=3.0.2 + [pbr] warnerrors = true autodoc_tree_index_modules = True diff --git a/test-requirements.txt b/test-requirements.txt index 60409a49..8463ff93 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,6 +6,3 @@ mock>=1.2 oslotest>=1.10.0 # Apache-2.0 oslosphinx>=2.5.0 # Apache-2.0 sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 - -# Optional dogpile backend: MongoDB -pymongo>=3.0.2 diff --git a/tox.ini b/tox.ini index 2caa42d3..e3bc0d19 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,8 @@ envlist = py34,py26,py27,pypy,pep8 install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/requirements.txt +deps = .[dogpile] + .[mongo] -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}'