)]}'
{
  "commit": "c53d075efb1d85d94d510836a41aab2e536317e1",
  "tree": "14d04c1c27107714df96d586d7049ee171952b47",
  "parents": [
    "32b00530160c3a8894350fab7a195540df89819d"
  ],
  "author": {
    "name": "Logan Pulley",
    "email": "logan@pulley.host",
    "time": "Fri Jun 09 18:19:32 2023 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Jun 09 23:19:32 2023 +0000"
  },
  "message": "fix: use `only-binary` for `download_only` `pip download` (#1219)\n\n[`wheel_installer` assumes that if the pip command succeeded, there must\nbe at least one `*.whl`\nfile](https://github.com/lpulley/rules_python/blob/fdec44120aa45d748ab804f1d019002c6949b449/python/pip_install/tools/wheel_installer/wheel_installer.py#L439),\nbut this is not currently true when `download_only` is enabled and the\npackage provides no wheel; a `.tar.gz` will happily be downloaded, pip\nwill succeed, and the `next(iter(glob.glob(\"*.whl\")))` call will fail,\nproducing a mysterious `StopIteration`:\n\n```\nSaved ./artifactory-0.1.17.tar.gz\nSuccessfully downloaded artifactory\n (Traceback (most recent call last):\n  File \"[redacted]/lib/python3.8/runpy.py\", line 194, in _run_module_as_main\n    return _run_code(code, main_globals, None,\n  File \"[redacted]/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"[redacted]/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py\", line 450, in \u003cmodule\u003e\n    main()\n  File \"[redacted]/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py\", line 438, in main\n    whl \u003d next(iter(glob.glob(\"*.whl\")))\nStopIteration\n)\n```\n\nBy using `--only-binary\u003d:all:` when using `pip download`, the pip\ncommand will fail if there is no suitable wheel to be downloaded. This\nshould make the error much more obvious, since with\n`--only-binary\u003d:all:` and no suitable wheel, pip fails and reports an\nerror like this:\n\n```\nERROR: Could not find a version that satisfies the requirement artifactory (from versions: none)\nERROR: No matching distribution found for artifactory\n```",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "77aa3a406c06ec750c8dd79ac0d97ecf4ed54156",
      "old_mode": 33188,
      "old_path": "python/pip_install/tools/wheel_installer/wheel_installer.py",
      "new_id": "5a6f49bb5b9a02b8b6bedbf0149aad37d5231257",
      "new_mode": 33188,
      "new_path": "python/pip_install/tools/wheel_installer/wheel_installer.py"
    }
  ]
}
