diff --git a/tests/pypi b/tests/pypi index 1881ecb4..77faecd4 160000 --- a/tests/pypi +++ b/tests/pypi @@ -1 +1 @@ -Subproject commit 1881ecb45431952d2e18e2be3416a8835e53778a +Subproject commit 77faecd45e85b14448667bc16af32ddfe6f8d42d diff --git a/tests/pytest-pypi/pytest_pypi/app.py b/tests/pytest-pypi/pytest_pypi/app.py index f1812af3..151c26b4 100644 --- a/tests/pytest-pypi/pytest_pypi/app.py +++ b/tests/pytest-pypi/pytest_pypi/app.py @@ -16,7 +16,7 @@ from six.moves import xmlrpc_client from flask import Flask, redirect, abort, render_template, send_file, jsonify -ReleaseTuple = collections.namedtuple("ReleaseTuple", ["path", "requires_python"]) +ReleaseTuple = collections.namedtuple("ReleaseTuple", ["path", "requires_python", "hash"]) app = Flask(__name__) session = requests.Session() @@ -86,13 +86,17 @@ class Package(object): path_to_binary = os.path.abspath(path_to_binary) path, release = os.path.split(path_to_binary) requires_python = "" + hash_value = "" if path_to_binary.endswith(".whl"): pkg = distlib.wheel.Wheel(path_to_binary) md_dict = pkg.metadata.todict() requires_python = md_dict.get("requires_python", "") if requires_python.count(".") > 1: requires_python, _, _ = requires_python.rpartition(".") - self.releases[release] = ReleaseTuple(path_to_binary, requires_python) + if os.path.isfile(path_to_binary + ".sha256"): + with open(path_to_binary + ".sha256") as f: + hash_value = f.read().strip() + self.releases[release] = ReleaseTuple(path_to_binary, requires_python, hash_value) self._package_dirs.add(ReleaseTuple(path, requires_python)) diff --git a/tests/pytest-pypi/pytest_pypi/templates/package.html b/tests/pytest-pypi/pytest_pypi/templates/package.html index 3d364517..f8c5858a 100644 --- a/tests/pytest-pypi/pytest_pypi/templates/package.html +++ b/tests/pytest-pypi/pytest_pypi/templates/package.html @@ -7,7 +7,7 @@