Local Package Identifiers not currently supported in Gitea #9782

Closed
opened 2025-11-02 08:49:29 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Racer159 on GitHub (Nov 4, 2022).

Description

When running Gitea as a private PyPi package registry there may be packages that do not match the canonical public version and instead use a local version identifier as outlined in PEP-0440. An example of this could be an internally forked version of certify https://pypi.org/project/certifi/#files that includes custom CAs specific to that organization.

When attempting to use these packages with Gitea it will return a 400 Bad Request with "invalid name or version"

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/Racer159/8aa895f1ffd62fb56d567d26e812c973

Screenshots

image

Git Version

2.38.0

Operating System

popOS 22.04

How are you running Gitea?

For this testing/log locally off of the main branch, but in production it is inside of the official Gitea chart, specifically version 6.0.3.

Database

SQLite

Originally created by @Racer159 on GitHub (Nov 4, 2022). ### Description When running Gitea as a private PyPi package registry there may be packages that do not match the canonical public version and instead use a [local version identifier](https://peps.python.org/pep-0440/#local-version-identifiers) as outlined in PEP-0440. An example of this could be an internally forked version of `certify` https://pypi.org/project/certifi/#files that includes custom CAs specific to that organization. When attempting to use these packages with Gitea it will return a 400 Bad Request with "invalid name or version" ### Gitea Version 1.17.3 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/Racer159/8aa895f1ffd62fb56d567d26e812c973 ### Screenshots ![image](https://user-images.githubusercontent.com/3977569/200018665-6150a271-a5f1-40b1-9654-ee1345fbf3ff.png) ### Git Version 2.38.0 ### Operating System popOS 22.04 ### How are you running Gitea? For this testing/log locally off of the main branch, but in production it is inside of the official Gitea chart, specifically version 6.0.3. ### Database SQLite
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 08:49:30 -06:00
Author
Owner

@Racer159 commented on GitHub (Nov 4, 2022):

Also as a note, to quickly make a version that matches you can do the following:

  1. Download the latest Built version of certify from here: https://pypi.org/project/certifi/#files
  2. Extract the .whl as a zip archive
  3. Rename the .dist-info folder to include the +<local_id>
    image
  4. Inside of that folder, edit the METADATA file to include the +<local_id> on its version
    image
  5. Rezip the two folders into a .whl named with the new local id version. (these folders should be at the root of the archive)
    image
@Racer159 commented on GitHub (Nov 4, 2022): Also as a note, to quickly make a version that matches you can do the following: 1. Download the latest Built version of certify from here: https://pypi.org/project/certifi/#files 2. Extract the .whl as a zip archive 3. Rename the .dist-info folder to include the `+<local_id>` ![image](https://user-images.githubusercontent.com/3977569/200023515-3382deef-7496-4c90-9a03-54b1e8e6a9fb.png) 4. Inside of that folder, edit the METADATA file to include the `+<local_id>` on its version ![image](https://user-images.githubusercontent.com/3977569/200023672-38e56251-1362-44e9-a729-6f0acb25ccc7.png) 5. Rezip the two folders into a .whl named with the new local id version. (these folders should be at the root of the archive) ![image](https://user-images.githubusercontent.com/3977569/200024101-24c47271-6853-47b7-abb9-8af8a206ddd8.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9782