pypa/pip

Report install errors and failures in JSON format

Open

#11,316 opened on 2022年7月27日

GitHub で見る
 (6 comments) (5 reactions) (0 assignees)Python (8,952 stars) (3,032 forks)batch import
C: error messagesC: install reporthelp wantedstate: needs discussiontype: feature request

説明

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

コントリビューターガイド

Report install errors and failures in JSON format · pypa/pip#11316 | Good First Issue