Skip to content

Use Project-URL metadata field to get a PyPI package's homepage URL #33089

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

Merged

Conversation

kemzeb
Copy link
Member

@kemzeb kemzeb commented Jan 3, 2025

Resolves #33085.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 3, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Jan 3, 2025
@kemzeb
Copy link
Member Author

kemzeb commented Jan 3, 2025

Still need to write some integration tests, but I tested this manually with a personal PyPI project that uses the Project-URL field to set the homepage. I uploaded it using the instructions from the Gitea docs and it uploaded just fine. I navigated to the package's homepage and can now see the project directory:

Before:
Screenshot 2025-01-02 at 5 49 10 PM

After:
Screenshot 2025-01-02 at 5 50 19 PM

Couple things:

  • I kept the Home-page metadata field around. Not sure if there are packages that use this field but just in case I kept it around. Let me know if we should just remove it
  • Since we have to loop over these URLs, should we set some arbitrary limit as to the number of URLs we should loop over?

Edit:

BTW, here are some references I used:

@kemzeb
Copy link
Member Author

kemzeb commented Jan 3, 2025

Going to open this. I did modify an integration test to test for project URL metadata but the existing tests are dependent on each other which makes it harder to add more. Let me know if I should do something about this

@kemzeb kemzeb marked this pull request as ready for review January 3, 2025 05:23
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 3, 2025
@kemzeb
Copy link
Member Author

kemzeb commented Jan 3, 2025

I understand the tests a tad more and was able to add the necessary coverage tests

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 3, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 3, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 3, 2025
@lunny lunny enabled auto-merge (squash) January 3, 2025 20:44
@lunny lunny merged commit 188e0ee into go-gitea:main Jan 3, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Jan 3, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 3, 2025
@kemzeb kemzeb deleted the feat/api/use-project-url-to-get-homepage-url branch January 3, 2025 23:19
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 6, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Fix dropdown menu header and mobile view (go-gitea#33108)
  workflow_dispatch use workflow from trigger branch (go-gitea#33098)
  [skip ci] Updated translations via Crowdin
  Trivial fixes (go-gitea#33103)
  Fix empty git repo handling logic (go-gitea#33101)
  Refactor legacy line-number and scroll code (go-gitea#33094)
  Use `Project-URL` metadata field to get a PyPI package's homepage URL (go-gitea#33089)
  Clean up legacy form CSS styles (go-gitea#33081)
  [skip ci] Updated translations via Crowdin
  add myself to maintainers (go-gitea#33088)
  Make Gitea always use its internal config, ignore `/etc/gitconfig` (go-gitea#33076)
  Fix "stop time tracking button" on navbar (go-gitea#33084)
  Fix bleve fuzziness search (go-gitea#33078)
  Try to fix ACME directory problem (go-gitea#33072)
  Refactor env var related code (go-gitea#33075)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code topic/packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update PyPi package registry to use project.urls from pyproject.toml
4 participants