Commit c53d075
authored
[`wheel_installer` assumes that if the pip command succeeded, there must
be at least one `*.whl`
file](https://github.com/lpulley/rules_python/blob/fdec44120aa45d748ab804f1d019002c6949b449/python/pip_install/tools/wheel_installer/wheel_installer.py#L439),
but this is not currently true when `download_only` is enabled and the
package provides no wheel; a `.tar.gz` will happily be downloaded, pip
will succeed, and the `next(iter(glob.glob("*.whl")))` call will fail,
producing a mysterious `StopIteration`:
```
Saved ./artifactory-0.1.17.tar.gz
Successfully downloaded artifactory
(Traceback (most recent call last):
File "[redacted]/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "[redacted]/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "[redacted]/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 450, in <module>
main()
File "[redacted]/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 438, in main
whl = next(iter(glob.glob("*.whl")))
StopIteration
)
```
By using `--only-binary=:all:` when using `pip download`, the pip
command will fail if there is no suitable wheel to be downloaded. This
should make the error much more obvious, since with
`--only-binary=:all:` and no suitable wheel, pip fails and reports an
error like this:
```
ERROR: Could not find a version that satisfies the requirement artifactory (from versions: none)
ERROR: No matching distribution found for artifactory
```
1 parent 32b0053 commit c53d075
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
| 410 | + | |
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
| |||
0 commit comments