This commit is contained in:
ahmadbilalkhalid 2019-08-29 22:51:43 +05:00
parent 87f7767af5
commit bd43624689
5 changed files with 19 additions and 3 deletions

View File

@ -70,5 +70,5 @@ def setup(path, auth_name, auth_seed, auth_realm,
)
shutil.copytree(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

@ -47,6 +47,7 @@ def setup(path, base_dir, file_prefix, etcd_url, etcd_password):
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
)
op_result.add(PipenvOperation.create, path=repo_name, site_packages=True)
op_result.add(PipenvOperation.install, path=repo_name)
# Write Crontab entry

View File

@ -67,6 +67,19 @@ class GitOperation(object):
class PipenvOperation(object):
@staticmethod
def create(path=".", site_packages=False):
if site_packages:
command = f"pipenv --site-packages --python 3.7"
else:
command = "pipenv --python 3.7"
try:
output = subprocess.check_output(command.split(), cwd=path)
except subprocess.CalledProcessError as e:
return Result(e, ResultType.failure, inspect.currentframe().f_code.co_name)
else:
return Result(output, ResultType.success)
@staticmethod
def install(path=".", package_name=None):
if package_name:

View File

@ -60,5 +60,6 @@ def setup(path, ssh_username, ssh_key_path, ssh_key_pass, etcd_url, etcd_passwor
shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"),
dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper"))
op_result.add(PipenvOperation.create, path=repo_name, site_packages=True)
op_result.add(PipenvOperation.install, path=repo_name)

View File

@ -45,7 +45,8 @@ def setup(path, base_dir, etcd_url, etcd_password):
path=repo_name,
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
)
op_result.add(PipenvOperation.create, path=repo_name, site_packages=True)
op_result.add(PipenvOperation.install, path=repo_name)
# Write Crontab entry