a
This commit is contained in:
parent
294d7790fd
commit
15e3d10d0b
8 changed files with 6 additions and 4 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,7 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
import inspect
|
import inspect
|
||||||
|
import os
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from abc import ABC
|
from abc import ABC
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
@ -82,13 +84,12 @@ class PipenvOperation(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def install(path=".", package_name=None):
|
def install(path=".", package_name=None):
|
||||||
pip_install_options = "PIP_INSTALL_OPTION=\"-- --jobs=6\""
|
|
||||||
if package_name:
|
if package_name:
|
||||||
command = [pip_install_options, "pipenv", "install", package_name]
|
command = f"pipenv install {package_name}"
|
||||||
else:
|
else:
|
||||||
command = [pip_install_options, "pipenv", "install"]
|
command = f"pipenv install"
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(command, cwd=path)
|
output = subprocess.check_output(command.split(), cwd=path, env={**os.environ, "PIP_INSTALL_OPTION": "-- --jobs=8"})
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
return Result(e, ResultType.failure, inspect.currentframe().f_code.co_name)
|
return Result(e, ResultType.failure, inspect.currentframe().f_code.co_name)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
1
ucloud-api
Submodule
1
ucloud-api
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9aeb05987bd1b84e7ac851ce8b84f31647e436bd
|
||||||
Loading…
Add table
Add a link
Reference in a new issue