This commit is contained in:
ahmadbilalkhalid 2019-08-30 15:55:10 +05:00
parent e1b0db05b3
commit 64cc099519
2 changed files with 6 additions and 3 deletions

View File

@ -79,4 +79,5 @@ def setup(
src=os.path.join(repo_name, "etcd3_wrapper"),
dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper"),
)
op.add(PipenvOperation.create, path=repo_name, site_packages=True)
op.add(PipenvOperation.install, path=repo_name)

View File

@ -101,9 +101,9 @@ class PipenvOperation(object):
@staticmethod
def create(path=".", site_packages=False):
if site_packages:
command = f"pipenv --site-packages --python 3.7"
command = f"pipenv --site-packages --python 3"
else:
command = "pipenv --python 3.7"
command = "pipenv --python 3"
try:
output = subprocess.check_output(command.split(), cwd=path)
except subprocess.CalledProcessError as e:
@ -116,7 +116,9 @@ class PipenvOperation(object):
if package_name:
command = f"pipenv install {package_name}"
else:
command = f"pipenv install"
with open(os.path.join(path, "requirements.txt"), "w") as f:
subprocess.Popen("pipenv run pip freeze".split(), cwd=path, stdout=f)
command = f"pip install -r requirements.txt"
try:
output = subprocess.check_output(command.split(), cwd=path)
except subprocess.CalledProcessError as e: