mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-07 13:26:08 +00:00
Fix very old pip version support (<20)
This commit is contained in:
parent
7f5b3c8df4
commit
667c2ced3d
@ -50,6 +50,14 @@ class ExternalRequirements(SimpleSubstitution):
|
|||||||
print("No need to reinstall \'{}\' from VCS, "
|
print("No need to reinstall \'{}\' from VCS, "
|
||||||
"the exact same version is already installed".format(req.name))
|
"the exact same version is already installed".format(req.name))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if not req.pip_new_version:
|
||||||
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
|
freeze_base = PackageManager.out_of_scope_freeze() or dict(pip=[])
|
||||||
|
except Exception:
|
||||||
|
freeze_base = dict(pip=[])
|
||||||
|
|
||||||
req_line = self._add_vcs_credentials(req, session)
|
req_line = self._add_vcs_credentials(req, session)
|
||||||
|
|
||||||
# if we have older pip version we have to make sure we replace back the package name with the
|
# if we have older pip version we have to make sure we replace back the package name with the
|
||||||
@ -58,14 +66,14 @@ class ExternalRequirements(SimpleSubstitution):
|
|||||||
PackageManager.out_of_scope_install_package(req_line, "--no-deps")
|
PackageManager.out_of_scope_install_package(req_line, "--no-deps")
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
freeze_post = PackageManager.out_of_scope_freeze() or ''
|
freeze_post = PackageManager.out_of_scope_freeze() or dict(pip=[])
|
||||||
package_name = list(set(freeze_post['pip']) - set(freeze_base['pip']))
|
package_name = list(set(freeze_post['pip']) - set(freeze_base['pip']))
|
||||||
if package_name and package_name[0] not in self.post_install_req_lookup:
|
if package_name and package_name[0] not in self.post_install_req_lookup:
|
||||||
self.post_install_req_lookup[package_name[0]] = req.req.line
|
self.post_install_req_lookup[package_name[0]] = req.req.line
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# no need to force reinstall, pip will always rebuilt if the package comes from git
|
# no need to force reinstall, pip will always rebuild if the package comes from git
|
||||||
# and make sure the required packages are installed (if they are not it will install them)
|
# and make sure the required packages are installed (if they are not it will install them)
|
||||||
if not PackageManager.out_of_scope_install_package(req_line):
|
if not PackageManager.out_of_scope_install_package(req_line):
|
||||||
raise ValueError("Failed installing GIT/HTTPs package \'{}\'".format(req_line))
|
raise ValueError("Failed installing GIT/HTTPs package \'{}\'".format(req_line))
|
||||||
|
Loading…
Reference in New Issue
Block a user