Skip to content

Commit 9ebb6d1

Browse files
committed
Remove MD5 checksums
1 parent c6a4d1e commit 9ebb6d1

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

add_to_pydotorg.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ def sigfile_for(release: str, rfile: str) -> str:
172172
return download_root + f"{release}/{rfile}.asc"
173173

174174

175-
def md5sum_for(filename: str) -> str:
176-
return hashlib.md5(
177-
open(filename, "rb").read(),
178-
).hexdigest()
179-
180-
181175
def sha256sum_for(filename: str) -> str:
182176
"""Returns SHA-256 checksum for filename."""
183177
return hashlib.sha256(open(filename, "rb").read()).hexdigest()
@@ -235,7 +229,6 @@ def build_file_dict(
235229
"description": add_desc,
236230
"is_source": os_pk == 3,
237231
"url": download_root + f"{base_version(release)}/{rfile}",
238-
"md5_sum": md5sum_for(filename),
239232
"sha256_sum": sha256sum_for(filename),
240233
"filesize": filesize_for(filename),
241234
"download_button": add_download,

release.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,11 @@ def tarball(source: str, clamp_mtime: str) -> None:
590590
)
591591
print("Making .tar.xz")
592592
run_cmd(["tar", "cJf", xz, *repro_options, source])
593-
print("Calculating md5 sums")
594-
checksum_tgz = hashlib.md5()
593+
print("Calculating SHA-256 sums")
594+
checksum_tgz = hashlib.sha256()
595595
with open(tgz, "rb") as data:
596596
checksum_tgz.update(data.read())
597-
checksum_xz = hashlib.md5()
597+
checksum_xz = hashlib.sha256()
598598
with open(xz, "rb") as data:
599599
checksum_xz.update(data.read())
600600
print(f" {checksum_tgz.hexdigest()} {os.path.getsize(tgz):8} {tgz}")

tests/test_add_to_pydotorg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def test_build_file_dict(tmp_path: Path) -> None:
7070
"description": "Test description",
7171
"is_source": False,
7272
"url": f"{release_url}/test-artifact.txt",
73-
"md5_sum": "3e25960a79dbc69b674cd4ec67a72c62",
7473
"sha256_sum": "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c",
7574
"filesize": 11,
7675
"download_button": True,

tests/test_sbom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def test_fetch_project_metadata_from_pypi(mocker):
111111
{
112112
"digests": {
113113
"blake2b_256": "94596638090c25e9bc4ce0c42817b5a234e183872a1129735a9330c472cc2056",
114-
"md5": "1331aabb4d1a2677f493effeebda3605",
115114
"sha256": "ea9bd1a847e8c5774a5777bb398c19e80bcd4e2aa16a4b301b718fe6f593aba2",
116115
},
117116
"filename": "pip-24.0.tar.gz",
@@ -121,7 +120,6 @@ def test_fetch_project_metadata_from_pypi(mocker):
121120
{
122121
"digests": {
123122
"blake2b_256": "8a6a19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b",
124-
"md5": "74e3c5e4082113b1239ca0e9abfd1e82",
125123
"sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc",
126124
},
127125
"filename": "pip-24.0-py3-none-any.whl",

0 commit comments

Comments
 (0)