diff options
author | Monty Taylor <mordred@inaugust.com> | 2013-07-30 12:55:32 -0400 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2013-07-30 12:55:32 -0400 |
commit | bb8bdf0e767a65959278ceac252491c5db904360 (patch) | |
tree | 0834a785b2f32a71973e88d956ddd980a0704ef0 | |
parent | 1273cbdd7c75d768901435e9228f1b745a7f681c (diff) | |
download | pbr-bb8bdf0e767a65959278ceac252491c5db904360.tar.gz |
Remove missing_reuqires optimization
The attempt to optimize away some shell calls to pip wound up having
python setup.py install not do the right thing with missing transitive
depends. Remove the optimization check.
Change-Id: I0db9cc18fda98b8f53b61422e730fd76e0c6a0c1
-rw-r--r-- | pbr/packaging.py | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py index 8afbde7..25e3db8 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -79,35 +79,19 @@ def _make_links_args(links): return ["-f '%s'" % link for link in links] -def _missing_requires(requires): - """Return the list of requirements that are not already installed. - - Do this check explicitly, because it's very easy to see if a package - is in the current working set, to avoid shelling out to pip and attempting - an install. pip will do the right thing, but we don't need to do the - excess work on everyone's machines all the time (especially since tox - likes re-installing things a lot) - """ - return [r for r in requires - if not pkg_resources.working_set.find( - pkg_resources.Requirement.parse(r))] - - def _pip_install(links, requires, root=None): if str(os.getenv('SKIP_PIP_INSTALL', '')).lower() in TRUE_VALUES: return root_cmd = "" if root: root_cmd = "--root=%s" % root - missing_requires = _missing_requires(requires) - if missing_requires: - _run_shell_command( - "%s -m pip.__init__ install %s %s %s" % ( - sys.executable, - root_cmd, - " ".join(links), - " ".join(_wrap_in_quotes(missing_requires))), - throw_on_error=True, buffer=False) + _run_shell_command( + "%s -m pip.__init__ install %s %s %s" % ( + sys.executable, + root_cmd, + " ".join(links), + " ".join(_wrap_in_quotes(requires))), + throw_on_error=True, buffer=False) def read_git_mailmap(git_dir, mailmap='.mailmap'): |