Skip to content
This repository was archived by the owner on Mar 27, 2019. It is now read-only.

use pip via subprocess, not pip.main #57

Merged
merged 2 commits into from
Jun 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions langserver/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import shutil
import logging

import pip

from typing import List

log = logging.getLogger(__name__)
Expand All @@ -25,12 +23,12 @@ def fetch_dependency(module_name: str, specifier: str, install_path: str, pip_ar
module_name, download_folder, exc_info=True)
# TODO: check the result status

result = pip.main(
["download", "--no-deps", "-d", download_folder] +
result = subprocess.run(
["pip", "download", "--no-deps", "-d", download_folder] +
pip_args +
[module_name + specifier]
)
if result != 0:
if result.returncode != 0:
log.error("Unable to fetch package %s", module_name)
return
for thing in os.listdir(download_folder):
Expand Down