pypa/pip

Report install errors and failures in JSON format

Open

#11.316 aberto em 27 de jul. de 2022

Ver no GitHub
 (6 comments) (5 reactions) (0 assignees)Python (3.032 forks)batch import
C: error messagesC: install reporthelp wantedstate: needs discussiontype: feature request

Métricas do repositório

Stars
 (8.952 stars)
Métricas de merge de PR
 (Mesclagem média 13d 7h) (20 fundiu PRs em 30d)

Description

What's the problem this feature will solve?

Currently, pip install --report reports errors and exceptions in plain text which is inconvenient for parsing.

Describe the solution you'd like

Instead of

$ pip install pip-tools==6.8.0 pip==20.1 --dry-run --report -
ERROR: Cannot install pip-tools==6.8.0 and pip==20.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested pip==20.1
    pip-tools 6.8.0 depends on pip>=21.2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

report errors and exceptions in JSON format, for example:

$ pip install pip-tools==6.8.0 pip==20.1 --dry-run --report -
{
  "error": {
    "code": "resolution_impossible",
    "description": "Cannot install pip-tools==6.8.0 and pip==20.1 because these package versions have conflicting dependencies",
    "extra": {
      "requirements": ["pip"]
    }
  }
}

Alternative Solutions

Let users parse plain text and let them hope for the best.

Additional context

https://github.com/jazzband/pip-tools/issues/1654#issuecomment-1197269367

Code of Conduct

Guia do colaborador