Skip to content
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ END_UNRELEASED_TEMPLATE
### Removed
* Nothing removed.

{#1-4-1}
## [1.4.1] - 2025-05-08

[1.4.1]: https://github.com/bazel-contrib/rules_python/releases/tag/1.4.1

{#1-4-1-fixed}
### Fixed
* (pypi) Fix a typo not allowing users to benefit from using the downloader when the hashes in the
requirements file are not present. Fixes
[#2863](https://github.com/bazel-contrib/rules_python/issues/2863).

{#1-4-0}
## [1.4.0] - 2025-04-19

Expand Down
6 changes: 3 additions & 3 deletions python/private/pypi/parse_simpleapi_html.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parse_simpleapi_html(*, url, content):

# Each line follows the following pattern
# <a href="https://...#sha256=..." attribute1="foo" ... attributeN="bar">filename</a><br />
sha256_by_version = {}
sha256s_by_version = {}
for line in lines[1:]:
dist_url, _, tail = line.partition("#sha256=")
dist_url = _absolute_url(url, dist_url)
Expand All @@ -65,7 +65,7 @@ def parse_simpleapi_html(*, url, content):
head, _, _ = tail.rpartition("</a>")
maybe_metadata, _, filename = head.rpartition(">")
version = _version(filename)
sha256_by_version.setdefault(version, []).append(sha256)
sha256s_by_version.setdefault(version, []).append(sha256)

metadata_sha256 = ""
metadata_url = ""
Expand Down Expand Up @@ -102,7 +102,7 @@ def parse_simpleapi_html(*, url, content):
return struct(
sdists = sdists,
whls = whls,
sha256_by_version = sha256_by_version,
sha256s_by_version = sha256s_by_version,
)

_SDIST_EXTS = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def _test_sdist(env):
got = parse_simpleapi_html(url = input.url, content = html)
env.expect.that_collection(got.sdists).has_size(1)
env.expect.that_collection(got.whls).has_size(0)
env.expect.that_collection(got.sha256s_by_version).has_size(1)
if not got:
fail("expected at least one element, but did not get anything from:\n{}".format(html))

Expand Down