summaryrefslogtreecommitdiff
path: root/pbr/packaging.py
diff options
context:
space:
mode:
Diffstat (limited to 'pbr/packaging.py')
-rw-r--r--pbr/packaging.py35
1 files changed, 10 insertions, 25 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index e08393e..ae58c95 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(root_dir=None, mailmap='.mailmap'):
@@ -448,7 +432,8 @@ if __name__ == "__main__":
"""
-def _get_script_args(dist, executable, is_wininst):
+def override_get_script_args(
+ dist, executable=os.path.normpath(sys.executable), is_wininst=False):
"""Override entrypoints console_script."""
header = easy_install.get_script_header("", executable, is_wininst)
for group in 'console_scripts', 'gui_scripts':
@@ -466,7 +451,7 @@ class LocalInstallScripts(install_scripts.install_scripts):
def run(self):
if os.name != 'nt':
- get_script_args = _get_script_args
+ get_script_args = override_get_script_args
else:
get_script_args = easy_install.get_script_args