comparison toolfactory/rgToolFactory2.py @ 137:63d15caea378 draft

Uploaded
author fubar
date Tue, 13 Apr 2021 03:06:27 +0000
parents 7805fdac70ed
children 1dba6c7687a9
comparison
equal deleted inserted replaced
136:94f5560de46d 137:63d15caea378
1041 """planemo is a requirement so is available for testing but needs a 1041 """planemo is a requirement so is available for testing but needs a
1042 different call if in the biocontainer - see above 1042 different call if in the biocontainer - see above
1043 and for generating test outputs if command or test overrides are 1043 and for generating test outputs if command or test overrides are
1044 supplied test outputs are sent to repdir for display 1044 supplied test outputs are sent to repdir for display
1045 """ 1045 """
1046 penv = os.environ
1047 pconfig = os.path.join(self.args.tool_dir,'.planemo.yml')
1048 penv["PLANEMO_GLOBAL_CONFIG_PATH"] = pconfig
1049 self.set_planemo_galaxy_root(self.args.galaxy_root,config_path=pconfig)
1046 xreal = "%s.xml" % self.tool_name 1050 xreal = "%s.xml" % self.tool_name
1047 tool_test_path = os.path.join( 1051 tool_test_path = os.path.join(
1048 self.repdir, f"{self.tool_name}_planemo_test_report.html" 1052 self.repdir, f"{self.tool_name}_planemo_test_report.html"
1049 ) 1053 )
1050 if os.path.exists(self.tlog): 1054 if os.path.exists(self.tlog):
1065 os.path.abspath(xreal), 1069 os.path.abspath(xreal),
1066 ] 1070 ]
1067 p = subprocess.run( 1071 p = subprocess.run(
1068 cll, 1072 cll,
1069 shell=False, 1073 shell=False,
1074 env = penv,
1070 cwd=self.tooloutdir, 1075 cwd=self.tooloutdir,
1071 stderr=tout, 1076 stderr=tout,
1072 stdout=tout, 1077 stdout=tout,
1073 ) 1078 )
1074 tout.close() 1079 tout.close()
1075 return p.returncode 1080 return p.returncode
1081
1082 def set_planemo_galaxy_root(self, galaxyroot='/galaxy-central', config_path=".planemo.yml"):
1083 # bug in planemo - bogus '--dev-wheels' passed to run_tests.sh as at april 2021 - need a fiddled copy so it is ignored until fixed
1084 CONFIG_TEMPLATE = f"""## Planemo Global Configuration File.
1085 ## Everything in this file is completely optional - these values can all be
1086 ## configured via command line options for the corresponding commands.
1087
1088 ## Specify a default galaxy_root for test and server commands here.
1089 galaxy_root: %s
1090 ## Username used with toolshed(s).
1091 #shed_username: "<TODO>"
1092 sheds:
1093 # For each tool shed you wish to target, uncomment key or both email and
1094 # password.
1095 toolshed:
1096 #key: "<TODO>"
1097 #email: "<TODO>"
1098 #password: "<TODO>"
1099 testtoolshed:
1100 #key: "<TODO>"
1101 #email: "<TODO>"
1102 #password: "<TODO>"
1103 local:
1104 #key: "<TODO>"
1105 #email: "<TODO>"
1106 #password: "<TODO>"
1107 """
1108 if not os.path.exists(config_path):
1109 with open(config_path, "w") as f:
1110 f.write(CONFIG_TEMPLATE % galaxyroot)
1076 1111
1077 1112
1078 def main(): 1113 def main():
1079 """ 1114 """
1080 This is a Galaxy wrapper. 1115 This is a Galaxy wrapper.