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 62f86230 authored by hm-schuhba1's avatar hm-schuhba1

add script to install analysis tools during gitlab CI pipeline

parent 843993c6
......@@ -10,6 +10,8 @@ __pycache__/
*.py[cod]
*$py.class
**/venv/
Tools/VadereAnalysisTool/dist/
Tools/VadereAnalysisTool/VadereAnalysisTool.egg-info/
# C extensions
*.so
......
......@@ -55,3 +55,13 @@ run_scenario_files:
- mvn -Dmaven.test.skip=true package
- python3 Tools/ContinuousIntegration/run_vadere_console_with_all_scenario_files.py
run_origin_test:
stage: deploy
script:
- Documentation/version-control/git-hook-vadere-software
- mvn clean
- mvn -Dmaven.test.skip=true package
- python3 Tools/ContinuousIntegration/install_vadere_analysis_tool.py
- python3 Tools/ContinuousIntegration/run_orign_translation_test.py
import getpass
import os
import re
import subprocess
def install_package_if_needed(package_name='VadereAnalysisTool', search_path='Tools/VadereAnalysisTool'):
try:
make_package_cwd = os.path.abspath(search_path)
print("Build package {}...".format(package_name))
p_make_package = subprocess.run(
args=["python3", "setup.py", "bdist_wheel"],
cwd= make_package_cwd,
timeout=10,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
print("ReturnCode: {}\nStdOut: {} \nStdErr: {}".format(p_make_package.returncode,
p_make_package.stdout.decode('utf8'),
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')
user = getpass.getuser()
print("Install package {} locally for user {} ...".format(package_name, user))
p_install_package = subprocess.run(
args=["python3", "-m", "pip", "install", "--user", dist_path],
cwd=make_package_cwd,
timeout=10,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
print("ReturnCode: {}\nStdOut: {} \nStdErr: {}".format(p_install_package.returncode,
p_install_package.stdout.decode('utf8'),
p_install_package.stderr.decode('utf8')))
else:
exit(1)
else:
exit(1)
except subprocess.TimeoutExpired as exception:
print("Timeout installing {} from path {}".format(package_name, search_path))
except subprocess.CalledProcessError as exception:
print("Error installing {} from path {}\n err:{}".format(package_name,
search_path,
exception.stderr))
if __name__ == '__main__':
install_package_if_needed()
Metadata-Version: 2.1
Name: VadereAnalysisTool
Version: 0.0.1
Summary: Import VadereProject to ease analysis
Home-page: UNKNOWN
Author: Stefan Schuhbäck
Author-email: stefan.schuhbaeck@hm.edu
License: UNKNOWN
Description: # Vadere Analysis Tool
Simplify import and analysis of simulation output in python an juypter-notebooks
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
README.md
setup.py
VadereAnalysisTool.egg-info/PKG-INFO
VadereAnalysisTool.egg-info/SOURCES.txt
VadereAnalysisTool.egg-info/dependency_links.txt
VadereAnalysisTool.egg-info/top_level.txt
vadere_analysis_tool/__init__.py
vadere_analysis_tool/helper.py
vadere_analysis_tool/scenario_output.py
vadere_analysis_tool/vadere_project.py
vadere_analysis_tool/vadere_runner.py
vadere_analysis_tool/analysis/__init__.py
vadere_analysis_tool/analysis/origin_deviation.py
vadere_analysis_tool/tests/__init__.py
vadere_analysis_tool/tests/scenario_output_test.py
vadere_analysis_tool/tests/vadere_project_test.py
\ No newline at end of file
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="VadereAnalysisTool",
version="0.0.1",
version="0.0.3",
author="Stefan Schuhbäck",
author_email="stefan.schuhbaeck@hm.edu",
description="Import VadereProject to ease analysis",
......
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