Merge pull request '[v7.0/forgejo] [BUG] Fix for PyPi Registry PEP 503 Compliance' (#3197) from bp-v7.0/forgejo-14badb3-303b95a into v7.0/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3197
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-12 23:07:36 +00:00
commit 88b6164f84
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@
{{range .PackageDescriptors}} {{range .PackageDescriptors}}
{{$p := .}} {{$p := .}}
{{range .Files}} {{range .Files}}
<a href="{{$.RegistryURL}}/files/{{$p.Package.LowerName}}/{{$p.Version.Version}}/{{.File.Name}}#sha256-{{.Blob.HashSHA256}}"{{if $p.Metadata.RequiresPython}} data-requires-python="{{$p.Metadata.RequiresPython}}"{{end}}>{{.File.Name}}</a><br> <a href="{{$.RegistryURL}}/files/{{$p.Package.LowerName}}/{{$p.Version.Version}}/{{.File.Name}}#sha256={{.Blob.HashSHA256}}"{{if $p.Metadata.RequiresPython}} data-requires-python="{{$p.Metadata.RequiresPython}}"{{end}}>{{.File.Name}}</a><br>
{{end}} {{end}}
{{end}} {{end}}
</body> </body>

View file

@ -164,7 +164,7 @@ func TestPackagePyPI(t *testing.T) {
nodes := htmlDoc.doc.Find("a").Nodes nodes := htmlDoc.doc.Find("a").Nodes
assert.Len(t, nodes, 2) assert.Len(t, nodes, 2)
hrefMatcher := regexp.MustCompile(fmt.Sprintf(`%s/files/%s/%s/test\..+#sha256-%s`, root, regexp.QuoteMeta(packageName), regexp.QuoteMeta(packageVersion), hashSHA256)) hrefMatcher := regexp.MustCompile(fmt.Sprintf(`%s/files/%s/%s/test\..+#sha256=%s`, root, regexp.QuoteMeta(packageName), regexp.QuoteMeta(packageVersion), hashSHA256))
for _, a := range nodes { for _, a := range nodes {
for _, att := range a.Attr { for _, att := range a.Attr {