Skip to content

Commit 9aeaa21

Browse files
committed
temp
1 parent 40f5319 commit 9aeaa21

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

pulp_python/app/migrations/0016_pythonpackagecontent_sha256_metadata_and_more.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Migration(migrations.Migration):
1313
migrations.AddField(
1414
model_name="pythonpackagecontent",
1515
name="sha256_metadata",
16-
field=models.CharField(default="", max_length=64),
16+
field=models.CharField(null=True, max_length=64),
1717
preserve_default=False,
1818
),
1919
migrations.AddField(

pulp_python/app/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class PythonPackageContent(Content):
192192
packagetype = models.TextField(choices=PACKAGE_TYPES)
193193
python_version = models.TextField()
194194
sha256 = models.CharField(db_index=True, max_length=64)
195-
sha256_metadata = models.CharField(max_length=64)
195+
sha256_metadata = models.CharField(max_length=64, null=True)
196196
yanked = models.BooleanField(default=False)
197197
yanked_reason = models.TextField()
198198

pulp_python/app/utils.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"""TODO This serial constant is temporary until Python repositories implements serials"""
1818
PYPI_SERIAL_CONSTANT = 1000000000
1919

20-
PYPI_API_VERSION = "1.0"
20+
SIMPLE_API_VERSION = "1.0"
2121

2222
simple_index_template = """<!DOCTYPE html>
2323
<html>
2424
<head>
2525
<title>Simple Index</title>
26-
<meta name="api-version" value="2" />
26+
<meta name="pypi:repository-version" content="{SIMPLE_API_VERSION}">
2727
</head>
2828
<body>
2929
{% for name, canonical_name in projects %}
@@ -37,7 +37,7 @@
3737
<html>
3838
<head>
3939
<title>Links for {{ project_name }}</title>
40-
<meta name="api-version" value="2" />
40+
<meta name="pypi:repository-version" content="{SIMPLE_API_VERSION}">
4141
</head>
4242
<body>
4343
<h1>Links for {{ project_name }}</h1>
@@ -429,7 +429,7 @@ def write_simple_detail(project_name, project_packages, streamed=False):
429429
def write_simple_index_json(project_names):
430430
"""Writes the simple index in JSON format."""
431431
return {
432-
"meta": {"api-version": PYPI_API_VERSION, "_last-serial": PYPI_SERIAL_CONSTANT},
432+
"meta": {"api-version": SIMPLE_API_VERSION, "_last-serial": PYPI_SERIAL_CONSTANT},
433433
"projects": [
434434
{"name": name, "_last-serial": PYPI_SERIAL_CONSTANT} for name in project_names
435435
],
@@ -439,7 +439,7 @@ def write_simple_index_json(project_names):
439439
def write_simple_detail_json(project_name, project_packages):
440440
"""Writes the simple detail page in JSON format."""
441441
return {
442-
"meta": {"api-version": PYPI_API_VERSION, "_last-serial": PYPI_SERIAL_CONSTANT},
442+
"meta": {"api-version": SIMPLE_API_VERSION, "_last-serial": PYPI_SERIAL_CONSTANT},
443443
"name": canonicalize_name(project_name),
444444
"files": [
445445
{
@@ -457,16 +457,14 @@ def write_simple_detail_json(project_name, project_packages):
457457
if package["yanked"] and package["yanked_reason"]
458458
else package["yanked"]
459459
),
460-
# gpg-sig (not in warehouse)
461-
# todo (from new PEPs):
462-
# size (v1.1, PEP 700)
463-
# upload-time (v1.1, PEP 700)
464-
# core-metadata (PEP 7.14)
465-
# provenance (v1.3, PEP 740)
460+
# TODO:
461+
# size, upload-time (v1.1, PEP 700)
462+
# core-metadata (PEP 714)
463+
# provenance and digital attestation (v1.3, PEP 740)
466464
}
467465
for package in project_packages
468466
],
469-
# todo (from new PEPs):
467+
# TODO:
470468
# versions (v1.1, PEP 700)
471469
# alternate-locations (v1.2, PEP 708)
472470
# project-status (v1.4, PEP 792 - pypi and docs differ)

0 commit comments

Comments
 (0)