Skip to content

Commit

Permalink
Make pip.wheel function take same args as pip.download
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-blanchard committed May 23, 2018
1 parent 32c3c06 commit 6f549ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/shiv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def build_wheels(wheel_dir: Path) -> None:
# build missing wheels
if to_build:
pip.wheel(
sys.executable,
["--wheel-dir", str(wheel_dir), '--find-links', str(wheel_dir)] + to_build,
)

Expand Down
6 changes: 3 additions & 3 deletions src/shiv/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ def download(args: List[str]) -> None:
sys.exit(PIP_DOWNLOAD_ERROR)


def wheel(interpreter_path: str, args: List[str]) -> None:
def wheel(args: List[str]) -> None:
"""`pip wheel` as a function.
Accepts a list of pip arguments.
.. code-block:: py
>>> wheel('/usr/local/bin/python3', ['numpy', '--wheel-dir', 'site-packages'])
>>> wheel(['numpy', '--wheel-dir', 'site-packages'])
Collecting numpy
Downloading https://files.pythonhosted.org/packages/8e/75/7a8b7e3c073562563473f2a61bd53e75d0a1f5e2047e576ee61d44113c22/numpy-1.14.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.7MB)
Saved ./site-packages/numpy-1.14.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Expand All @@ -86,7 +86,7 @@ def wheel(interpreter_path: str, args: List[str]) -> None:
with clean_pip_env():

process = subprocess.Popen(
[interpreter_path, "-m", "pip", "--disable-pip-version-check", "wheel"] + args,
[sys.executable, "-m", "pip", "--disable-pip-version-check", "wheel"] + args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
Expand Down

0 comments on commit 6f549ab

Please sign in to comment.