Commit 498f49ff by Sébastien Eustace

Use Github API to retrieve releases

parent 2eae3526
...@@ -264,7 +264,7 @@ class Installer: ...@@ -264,7 +264,7 @@ class Installer:
CURRENT_PYTHON = sys.executable CURRENT_PYTHON = sys.executable
CURRENT_PYTHON_VERSION = sys.version_info[:2] CURRENT_PYTHON_VERSION = sys.version_info[:2]
METADATA_URL = "https://pypi.org/pypi/poetry/json" METADATA_URL = "https://api.github.com/repos/sdispater/poetry/releases"
VERSION_REGEX = re.compile( VERSION_REGEX = re.compile(
"v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?" "v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?"
"(" "("
...@@ -349,7 +349,7 @@ class Installer: ...@@ -349,7 +349,7 @@ class Installer:
print("") print("")
releases = sorted( releases = sorted(
metadata["releases"].keys(), key=cmp_to_key(_compare_versions) [m["tag_name"] for m in metadata], key=cmp_to_key(_compare_versions)
) )
if self._version and self._version not in releases: if self._version and self._version not in releases:
......
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