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
This commit is contained in:
Matt Riedemann 2015-08-18 08:40:14 -07:00
parent c69635c195
commit 950a4448e3
4 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}'