summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-07-30 15:01:51 -0400
committerMonty Taylor <mordred@inaugust.com>2013-07-30 15:01:51 -0400
commit68462dd62b73beccda3ae4cff2628ab3f157585f (patch)
tree93c32c0957fa6552ed72af8d984cdd9bd5998826
parentbb8bdf0e767a65959278ceac252491c5db904360 (diff)
downloadpbr-68462dd62b73beccda3ae4cff2628ab3f157585f.tar.gz
Add skip_pip_install to setup.cfg
The envvar SKIP_PIP_INSTALL isn't enough in all cases. Add the ability to configure this in the config file. Change-Id: Ic84bd6df52d2b96bf4afcaacd9c8b6fee26e9840
-rw-r--r--pbr/packaging.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 25e3db8..a55daed 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -79,8 +79,9 @@ def _make_links_args(links):
return ["-f '%s'" % link for link in links]
-def _pip_install(links, requires, root=None):
- if str(os.getenv('SKIP_PIP_INSTALL', '')).lower() in TRUE_VALUES:
+def _pip_install(links, requires, root=None, option_dict=dict()):
+ if get_boolean_option(
+ option_dict, 'skip_pip_install', 'SKIP_PIP_INSTALL'):
return
root_cmd = ""
if root:
@@ -322,10 +323,13 @@ class LocalInstall(install.install):
command_name = 'install'
def run(self):
+ option_dict = self.distribution.get_option_dict('pbr')
if (not self.single_version_externally_managed
and self.distribution.install_requires):
links = _make_links_args(self.distribution.dependency_links)
- _pip_install(links, self.distribution.install_requires, self.root)
+ _pip_install(
+ links, self.distribution.install_requires, self.root,
+ option_dict=option_dict)
return du_install.install.run(self)
@@ -358,7 +362,10 @@ class _PipInstallTestRequires(object):
links = _make_links_args(
parse_dependency_links(TEST_REQUIREMENTS_FILES))
if self.distribution.tests_require:
- _pip_install(links, self.distribution.tests_require)
+ option_dict = self.distribution.get_option_dict('pbr')
+ _pip_install(
+ links, self.distribution.tests_require,
+ option_dict=option_dict)
def pre_run(self):
self.egg_name = pkg_resources.safe_name(self.distribution.get_name())