Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PyPi package registry to use project.urls from pyproject.toml #33085

Closed
satr-cowi opened this issue Jan 2, 2025 · 4 comments · Fixed by #33089
Closed

Update PyPi package registry to use project.urls from pyproject.toml #33085

satr-cowi opened this issue Jan 2, 2025 · 4 comments · Fixed by #33089
Labels
topic/packages type/enhancement An improvement of existing functionality

Comments

@satr-cowi
Copy link

Description

At the moment a link only seems to appear in the pypi package registry for setup.cfg files with a url field, which is translated to a Home-page metadata field. I believe this bit of meta-data has been deprecated recently: https://packaging.python.org/en/latest/specifications/core-metadata/#home-page

I believe the issue may be related to this line (but not fully sure):

projectURL := ctx.Req.FormValue("home_page")

Ideally links would appear in a similar way to that in pypi (Where the [project.urls] table can take homepage, documentation, tracker etc.)

The current documentation on what metadata is available and how it is used could also be heavily improved.

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

Windows Server

How are you running Gitea?

Running the .exe on a Windows Server

Database

PostgreSQL

@kemzeb
Copy link
Contributor

kemzeb commented Jan 2, 2025

If it is the case that we are using deprecated metadata to get the home page URL (to me this looks to be the case), then I agree that we should use something else to get this URL. What we should do is:

  • Use the Project-URL metadata (see here)
  • Since Project-URL can be defined multiple times (e.g a URL for its bug tracker, another for its project board, etc.), we look for one with the label homepage (this is after we normalize the label; see here for "well-known project URLs")
  • Use that as the URL for the homepage
  • If we couldn't find one with a normalized label of homepage, use the empty string (as we do already)

@kemzeb
Copy link
Contributor

kemzeb commented Jan 2, 2025

I'll see if I can implement something like this today

@satr-cowi
Copy link
Author

Hi guys, thanks for getting this implemented so quickly!

Not an urgent one, but would there be interest in the future in adding links for other project URLs too similar to pypi?

https://docs.pypi.org/project_metadata/

@lunny
Copy link
Member

lunny commented Jan 6, 2025

Hi guys, thanks for getting this implemented so quickly!

Not an urgent one, but would there be interest in the future in adding links for other project URLs too similar to pypi?

docs.pypi.org/project_metadata

Please create a new issue so that it can be found by contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/packages type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants