Cannot delete pypi package using the API #10036

Closed
opened 2025-11-02 08:56:29 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @waldner on GitHub (Jan 1, 2023).

Description

Trying to delete a pypi package using the API:

$ curl  -u "myuser:mypassword" -X DELETE https://mygit.example.com/api/packages/myorg/pypi/mypackage/0.0.1
404 page not found

the user has permissions for the org (in fact I use it to upload the packages), and the package definitely exists since I can access it from the web interface. Only thing logged in the logs:

gitea  | 2022/12/31 23:51:58 [63b0cb1e] router: completed DELETE /api/packages/myorg/pypi/mypackage/0.0.1 for 11.22.33.44:51094, 404 Not Found in 18.9ms @ packages/api.go:60(packages.Routes)

Can be reproduced in the demo site, with

$ twine upload -u myuser -p mypassword --repository-url "https://try.gitea.io/api/packages/myuser/pypi" /tmp/crypto_strategy-0.1.20-py3-none-any.whl 
Uploading distributions to https://try.gitea.io/api/packages/myuser/pypi
Uploading crypto_strategy-0.1.20-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.1/70.1 kB • 00:00 • 68.5 MB/s
$ curl -u "myuser:mypassword" -X DELETE https://try.gitea.io/api/packages/myuser/pypi/crypto-strategy/0.1.20
404 page not found

Gitea Version

1.18.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian 11

How are you running Gitea?

I'm using docker container.

Database

SQLite

Originally created by @waldner on GitHub (Jan 1, 2023). ### Description Trying to delete a pypi package using the API: ``` $ curl -u "myuser:mypassword" -X DELETE https://mygit.example.com/api/packages/myorg/pypi/mypackage/0.0.1 404 page not found ``` the user has permissions for the org (in fact I use it to upload the packages), and the package definitely exists since I can access it from the web interface. Only thing logged in the logs: ``` gitea | 2022/12/31 23:51:58 [63b0cb1e] router: completed DELETE /api/packages/myorg/pypi/mypackage/0.0.1 for 11.22.33.44:51094, 404 Not Found in 18.9ms @ packages/api.go:60(packages.Routes) ``` Can be reproduced in the demo site, with ``` $ twine upload -u myuser -p mypassword --repository-url "https://try.gitea.io/api/packages/myuser/pypi" /tmp/crypto_strategy-0.1.20-py3-none-any.whl Uploading distributions to https://try.gitea.io/api/packages/myuser/pypi Uploading crypto_strategy-0.1.20-py3-none-any.whl 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.1/70.1 kB • 00:00 • 68.5 MB/s $ curl -u "myuser:mypassword" -X DELETE https://try.gitea.io/api/packages/myuser/pypi/crypto-strategy/0.1.20 404 page not found ``` ### Gitea Version 1.18.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Debian 11 ### How are you running Gitea? I'm using docker container. ### Database SQLite
GiteaMirror added the issue/not-a-bug label 2025-11-02 08:56:29 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Jan 1, 2023):

The PyPI api does not provide a delete method. You can use the Gitea api to delete a package. https://gitea.com/api/swagger#/package/deletePackage

@KN4CK3R commented on GitHub (Jan 1, 2023): The PyPI api does not provide a delete method. You can use the Gitea api to delete a package. https://gitea.com/api/swagger#/package/deletePackage
Author
Owner

@waldner commented on GitHub (Jan 1, 2023):

That's what I used, isn't it?

@waldner commented on GitHub (Jan 1, 2023): That's what I used, isn't it?
Author
Owner

@waldner commented on GitHub (Jan 1, 2023):

Ah sorry, I was missing the v1 part. It works with that. thanks!

@waldner commented on GitHub (Jan 1, 2023): Ah sorry, I was missing the `v1` part. It works with that. thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10036