Repository 'tool_factory_2'
hg clone https://toolshed.g2.bx.psu.edu/repos/fubar/tool_factory_2

Changeset 147:4e83512cb72c (2021-04-18)
Previous changeset 146:2961862e2236 (2021-04-18) Next changeset 148:470d3e309508 (2021-04-18)
Commit message:
Uploaded
modified:
toolfactory/rgToolFactory2.py
b
diff -r 2961862e2236 -r 4e83512cb72c toolfactory/rgToolFactory2.py
--- a/toolfactory/rgToolFactory2.py Sun Apr 18 05:54:49 2021 +0000
+++ b/toolfactory/rgToolFactory2.py Sun Apr 18 07:59:23 2021 +0000
[
@@ -1043,6 +1043,13 @@
         and for generating test outputs if command or test overrides are
         supplied test outputs are sent to repdir for display
         """
+        penv = os.environ
+        # ourdir = os.getcwd()
+        # print('########## ourdir=',ourdir,'gr=',self.args.galaxy_root)
+        # pconfig = os.path.join(ourdir,'planemo', '.planemo.yml')
+        # penv["PLANEMO_GLOBAL_CONFIG_PATH"] = pconfig
+        # penv["HOME"] = ourdir
+        # # self.set_planemo_galaxy_root(self.args.galaxy_root, config_path=pconfig)
         xreal = "%s.xml" % self.tool_name
         tool_test_path = os.path.join(
             self.repdir, f"{self.tool_name}_planemo_test_report.html"
@@ -1054,6 +1061,8 @@
         cll = [
             "planemo",
             "test",
+            "--galaxy_python_version",
+            self.args.python_version,
             "--test_data",
             os.path.abspath(self.testdir),
             "--test_output",
@@ -1066,6 +1075,7 @@
         p = subprocess.run(
             cll,
             shell=False,
+            env=penv,
             cwd=self.tooloutdir,
             stderr=tout,
             stdout=tout,
@@ -1073,6 +1083,37 @@
         tout.close()
         return p.returncode
 
+    def set_planemo_galaxy_root(self, galaxyroot, config_path=".planemo.yml"):
+        # planemo tries to write to ~/.planemo - trying to convince it otherwise
+        CONFIG_TEMPLATE = """## Planemo Global Configuration File.
+## Everything in this file is completely optional - these values can all be
+## configured via command line options for the corresponding commands.
+## Specify a default galaxy_root for test and server commands here.
+galaxy_root: %s
+## Username used with toolshed(s).
+#shed_username: "<TODO>"
+sheds:
+  # For each tool shed you wish to target, uncomment key or both email and
+  # password.
+  toolshed:
+    #key: "<TODO>"
+    #email: "<TODO>"
+    #password: "<TODO>"
+  testtoolshed:
+    #key: "<TODO>"
+    #email: "<TODO>"
+    #password: "<TODO>"
+  local:
+    #key: "<TODO>"
+    #email: "<TODO>"
+    #password: "<TODO>"
+"""
+        if not os.path.exists(config_path):
+            with open(config_path, "w") as f:
+                f.write(CONFIG_TEMPLATE % galaxyroot)
+
+
+
 def main():
     """
     This is a Galaxy wrapper.