Add support for PEP 691 (JSON-based Simple Repository API) to PyPI Package Registry

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Title

Add support for PEP 691 (JSON-based Simple Repository API) to PyPI Package Registry

Description

GitLab’s PyPI Package Registry currently only implements the HTML-based Simple API (PEP 503).

The Python packaging ecosystem is moving toward the JSON-based Simple Repository API defined in PEP 691, which is now supported by PyPI (Warehouse) and increasingly preferred by modern tooling for performance and robustness.

https://packaging.python.org/en/latest/specifications/simple-repository-api/#simple-repository-api

At the moment, GitLab’s /simple/ endpoints do not support content negotiation for:

  • Accept: application/vnd.pypi.simple.v1+json

and tools that attempt to use the JSON API must fall back to HTML.

Request

Please consider adding support for PEP 691 to GitLab’s PyPI Package Registry, including:

  • Content negotiation via
    Accept: application/vnd.pypi.simple.v1+json
  • JSON responses for:
    • Project index endpoints (/simple/)
    • Package index endpoints (/simple/{project}/)

Specification

Motivation

  • Align GitLab with the official Python packaging standards
  • Improve compatibility with modern Python tooling
  • Reduce HTML scraping and improve performance for large private indexes
  • Enable future client optimizations that depend on the JSON API
Edited by 🤖 GitLab Bot 🤖