Commit c28728fb by Arun Babu Neelicattu

get-poetry: disallow installation of >= 1.2.0a1

Relates-to: #4040
parent 4ec09d4e
......@@ -449,6 +449,33 @@ class Installer:
break
def _is_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_supported(version):
print(
colorize(
"error",
f"Version {version} does not support this installation method. Please specify a version prior to "
f"1.2.0a1 explicitly using the '--version' option.\n"
"Please see "
"https://python-poetry.org/blog/announcing-poetry-1-2-0a1.html#deprecation-of-the-get-poetry-py-script "
"for more information.",
)
)
return None, None
print(
colorize(
"warning",
"This installer is deprecated. "
"Poetry versions installed using this script will not be able to use 'self update' command to upgrade to "
"1.2.0a1 or later.",
)
)
current_version = None
if os.path.exists(POETRY_LIB):
with open(
......@@ -824,7 +851,7 @@ class Installer:
HWND_BROADCAST,
WM_SETTINGCHANGE,
0,
u"Environment",
"Environment",
SMTO_ABORTIFHUNG,
5000,
ctypes.byref(result),
......
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