mirror of
https://github.com/python-poetry/install.python-poetry.org.git
synced 2024-11-24 23:10:57 -05:00
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
This commit is contained in:
parent
0ab3fa97c8
commit
ef8511c1de
1 changed files with 18 additions and 0 deletions
|
@ -413,6 +413,24 @@ class Installer:
|
|||
self.display_pre_message()
|
||||
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:
|
||||
self.install(version)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
Loading…
Reference in a new issue