pypa/pip

Report install errors and failures in JSON format

Open

#11.316 aperta il 27 lug 2022

Vedi su GitHub
 (6 commenti) (5 reazioni) (0 assegnatari)Python (3032 fork)batch import
C: error messagesC: install reporthelp wantedstate: needs discussiontype: feature request

Metriche repository

Star
 (8952 star)
Metriche merge PR
 (Merge medio 13g 7h) (20 PR mergiate in 30 g)

Descrizione

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

Guida contributor