Commit 2db6933b authored by Julien Muchembled's avatar Julien Muchembled

fixup! easy_install: add slapos.libnetworkcache support

This fixes caching of requirements without canonical versions.

See commit fb785cb3.
parent 78ced413
Pipeline #20964 passed with stage
in 0 seconds
...@@ -39,6 +39,7 @@ import tempfile ...@@ -39,6 +39,7 @@ import tempfile
import zc.buildout import zc.buildout
import warnings import warnings
from contextlib import closing from contextlib import closing
from distutils.version import StrictVersion
from setuptools.package_index import distros_for_location, URL_SCHEME from setuptools.package_index import distros_for_location, URL_SCHEME
WHL_DIST = pkg_resources.EGG_DIST + 1 WHL_DIST = pkg_resources.EGG_DIST + 1
...@@ -480,6 +481,10 @@ class Installer: ...@@ -480,6 +481,10 @@ class Installer:
return max(dists) return max(dists)
from .buildout import networkcache_client as nc from .buildout import networkcache_client as nc
if nc: if nc:
try: # clean up version (e.g. 5.2.0 -> 5.2)
version = str(StrictVersion(version))
except ValueError: # legacy version
pass
key = networkcache_key(requirement.key, version) key = networkcache_key(requirement.key, version)
if nc.tryDownload(key): if nc.tryDownload(key):
with nc: with nc:
......
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