From 5822c754ec691f84a9080a896fd8a31f5d66452e Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Tue, 18 Jul 2017 12:16:10 +0300 Subject: [PATCH] Put db requirements to extra requirements https://www.python.org/dev/peps/pep-0426/#extras-optional-dependencies Python is a great language and it support extra requirements. In our case, it can be used for listing database requirements. This patch adds two separate extra requirements: * psycopg2 as for Postgres database backend * PyMySQL as for MySQL database backend To install Rally with a specific database backend you need just to do execute pip in right way: pip install rally[postgres] or pip install rally[mysql] Change-Id: Ibf816758fc093a65b94e6a2b2c273a073275b393 --- setup.cfg | 6 ++++++ tox.ini | 1 + 2 files changed, 7 insertions(+) diff --git a/setup.cfg b/setup.cfg index 7c23aa92..812d3565 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,6 +39,12 @@ oslo.config.opts = setup-hooks = pbr.hooks.setup_hook +[extras] +mysql = + PyMySQL>=0.7.6 # MIT +postgres = + psycopg2>=2.5 # LGPL/ZPL + [build_sphinx] all_files = 1 build-dir = doc/build diff --git a/tox.ini b/tox.ini index d01a707b..f132cde3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ skipsdist = True envlist = py35,py34,py27,pep8 [testenv] +extras = {env:RALLY_EXTRAS:} setenv = VIRTUAL_ENV={envdir} HOME={homedir} LANG=en_US.UTF-8