mirror of
https://github.com/python-poetry/install.python-poetry.org.git
synced 2024-11-21 21:50:58 -05:00
installer: fix upgrade support check on scm version (#4126)
This commit is contained in:
parent
ef8511c1de
commit
4acfd05b53
1 changed files with 6 additions and 1 deletions
|
@ -415,10 +415,15 @@ class Installer:
|
||||||
|
|
||||||
def _is_self_upgrade_supported(x):
|
def _is_self_upgrade_supported(x):
|
||||||
mx = self.VERSION_REGEX.match(x)
|
mx = self.VERSION_REGEX.match(x)
|
||||||
|
|
||||||
|
if mx is None:
|
||||||
|
# the version is not semver, perhaps scm or file, we assume upgrade is supported
|
||||||
|
return True
|
||||||
|
|
||||||
vx = tuple(int(p) for p in mx.groups()[:3]) + (mx.group(5),)
|
vx = tuple(int(p) for p in mx.groups()[:3]) + (mx.group(5),)
|
||||||
return vx >= (1, 2, 0)
|
return vx >= (1, 2, 0)
|
||||||
|
|
||||||
if not _is_self_upgrade_supported(version):
|
if version and not _is_self_upgrade_supported(version):
|
||||||
self._write(
|
self._write(
|
||||||
colorize(
|
colorize(
|
||||||
"warning",
|
"warning",
|
||||||
|
|
Loading…
Reference in a new issue