pypa/pip

Report install errors and failures in JSON format

Open

#11,316 建立於 2022年7月27日

在 GitHub 查看
 (6 留言) (5 反應) (0 負責人)Python (8,952 star) (3,032 fork)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

貢獻者指南