Skip to content

feat(pypi): support PEP691 JSON API #282

Description

@mj0nez

Thanks for the project!

During setup I've noticed that the pypi handler does not yet support the PEP691 JSON API. Modern package managers like uv rely heavily upon the there provided metadata.

On a quick glance I think the reason is that the handler is requesting the text/html version while a package manager supporting the standard, would send Accept: application/vnd.pypi.simple.v1+json which must be passed to pypi for content negotiation. Currently. this blocks usage with uv and probably other package managers which us the metadata.

Reproduce:

#pyproject.toml
[project]
name = "test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = []
requires-python = ">=3.13"
dependencies = ["ruff>=0.16.0"]


[tool.uv]
package = false
exclude-newer = "7 days"  # enable / disable to trigger-   
no-build = true

[[tool.uv.index]]
url = "http://localhost:18080/pypi/simple/"
default = true
uv lock

or even simpler:

# public index
curl \                                                                                                                                                          
  -H 'Accept: application/vnd.pypi.simple.v1+json' \
  https://pypi.org/simple/ruff/ | jq

# a local proxy instance
curl \                                                                                                                                                          
  -H 'Accept: application/vnd.pypi.simple.v1+json' \
  http://localhost:18080/pypi/simple/ruff/

I would be willing to work on this because I need it, but that would probably be end of next week earliest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions