Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PEP 714 #13706

Merged
merged 4 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/unit/api/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def test_with_files_no_serial(self, db_request, content_type, renderer_override)
"size": f.size,
"upload-time": f.upload_time.isoformat() + "Z",
"data-dist-info-metadata": False,
"core-metadata": False,
}
for f in files
],
Expand Down Expand Up @@ -319,6 +320,7 @@ def test_with_files_with_serial(self, db_request, content_type, renderer_overrid
"size": f.size,
"upload-time": f.upload_time.isoformat() + "Z",
"data-dist-info-metadata": False,
"core-metadata": False,
}
for f in files
],
Expand Down Expand Up @@ -407,6 +409,9 @@ def test_with_files_with_version_multi_digit(
}
if f.metadata_file_sha256_digest is not None
else False,
"core-metadata": {"sha256": "deadbeefdeadbeefdeadbeefdeadbeef"}
if f.metadata_file_sha256_digest is not None
else False,
}
for f in files
],
Expand Down
3 changes: 3 additions & 0 deletions warehouse/packaging/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def _simple_detail(project, request):
"data-dist-info-metadata": {"sha256": file.metadata_file_sha256_digest}
if file.metadata_file_sha256_digest
else False,
"core-metadata": {"sha256": file.metadata_file_sha256_digest}
if file.metadata_file_sha256_digest
else False,
}
for file in files
],
Expand Down
2 changes: 1 addition & 1 deletion warehouse/templates/api/simple/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<body>
<h1>Links for {{ name }}</h1>
{% for file in files -%}
<a href="{{ file.url }}#sha256={{ file.hashes.sha256 }}" {% if file.get('requires-python') %}data-requires-python="{{ file['requires-python'] }}" {% endif %}{% if file.yanked %}data-yanked="{% if file.yanked is string %}{{ file.yanked }}{% endif %}" {% endif %}{% if file['data-dist-info-metadata'] %}data-dist-info-metadata="sha256={{ file['data-dist-info-metadata']['sha256'] }}"{% endif %}>{{ file.filename }}</a><br />
<a href="{{ file.url }}#sha256={{ file.hashes.sha256 }}" {% if file.get('requires-python') %}data-requires-python="{{ file['requires-python'] }}" {% endif %}{% if file.yanked %}data-yanked="{% if file.yanked is string %}{{ file.yanked }}{% endif %}" {% endif %}{% if file['core-metadata'] %}data-dist-info-metadata="sha256={{ file['core-metadata']['sha256'] }}" data-core-metadata="sha256={{ file['core-metadata']['sha256'] }}"{% endif %}>{{ file.filename }}</a><br />
{% endfor -%}
</body>
</html>
Expand Down