Commit bc814e1e by Arun Babu Neelicattu

install-poetry: add warning for < 1.2.0a1

When installing poetry < 1.2.0a1 add a warning indicating the breakage
of `self update` command usage.

Relates-to: #4040
parent c28728fb
...@@ -413,6 +413,24 @@ class Installer: ...@@ -413,6 +413,24 @@ class Installer:
self.display_pre_message() self.display_pre_message()
self.ensure_directories() self.ensure_directories()
def _is_self_upgrade_supported(x):
mx = self.VERSION_REGEX.match(x)
vx = tuple(int(p) for p in mx.groups()[:3]) + (mx.group(5),)
return vx >= (1, 2, 0)
if not _is_self_upgrade_supported(version):
self._write(
colorize(
"warning",
f"You are installing {version}. When using the current installer, this version does not support "
f"updating using the 'self update' command. Please use 1.2.0a1 or later.",
)
)
if not self._accept_all:
continue_install = input("Do you want to continue? ([y]/n) ") or "y"
if continue_install.lower() in {"n", "no"}:
return 0
try: try:
self.install(version) self.install(version)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment