Merge pull request '[BUG] Fix for PyPi Registry PEP 503 Compliance' (#3190) from Zottelchen/forgejo:bug/pep-503 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3190
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-12 22:19:51 +00:00
commit 828ae39c22
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 {