Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit a98fa19c authored by hm-schuhba1's avatar hm-schuhba1

fix install_vadere_analysis_tool.py

parent 89647a9a
Pipeline #75476 failed with stages
in 1 minute and 53 seconds
......@@ -2,6 +2,7 @@ import getpass
import os
import re
import subprocess
import shutil
def install_package_if_needed(package_name='VadereAnalysisTool', search_path='Tools/VadereAnalysisTool'):
......@@ -9,6 +10,9 @@ def install_package_if_needed(package_name='VadereAnalysisTool', search_path='To
make_package_cwd = os.path.abspath(search_path)
if os.path.exists(os.path.join(search_path, "dist")):
shutil.rmtree(os.path.join(search_path, "dist"))
print("Build package {}...".format(package_name))
p_make_package = subprocess.run(
args=["python3", "setup.py", "bdist_wheel"],
......@@ -22,12 +26,13 @@ def install_package_if_needed(package_name='VadereAnalysisTool', search_path='To
p_make_package.stderr.decode('utf8')))
if p_make_package.returncode == 0:
stdout = p_make_package.stdout.decode('utf8')
re_res = re.search("creating '(?P<name>.*?)'", stdout)
if re_res is not None:
dist_path = re_res.group('name')
dist_dir = os.path.join(search_path, "dist")
wheel_files = [f for f in os.listdir(dist_dir) if f.endswith(".whl")]
if len(wheel_files) > 0:
dist_path = os.path.join(search_path, "dist", wheel_files[0])
user = getpass.getuser()
print("Install package {} locally for user {} ...".format(package_name, user))
print("\nInstall package {} locally for user {} ...".format(dist_path, user))
p_install_package = subprocess.run(
args=["python3", "-m", "pip", "install", "--user", dist_path],
cwd=make_package_cwd,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment