From 68462dd62b73beccda3ae4cff2628ab3f157585f Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 30 Jul 2013 15:01:51 -0400 Subject: 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 --- pbr/packaging.py | 15 +++++++++++---- 1 file 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()) -- cgit v1.2.1