changeset 5:83407422ec16 draft default tip

Uploaded
author wolma
date Sat, 11 Jun 2016 19:07:41 -0400
parents 5e5653b689ca
children
files tool_dependencies.xml
diffstat 1 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tool_dependencies.xml	Fri Apr 29 06:00:29 2016 -0400
+++ b/tool_dependencies.xml	Sat Jun 11 19:07:41 2016 -0400
@@ -59,8 +59,10 @@
           <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[ZLIB_ROOT_PATH]/lib</environment_variable>
           <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[SQLITE_ROOT_DIR]/lib</environment_variable>
           <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
-          <environment_variable action="set_to" name="PYTHONPATH" />
+          <environment_variable action="set_to" name="PYTHONPATH">$INSTALL_DIR</environment_variable>
           <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
+          <environment_variable action="set_to" name="PYTHONNOUSERSITE">True</environment_variable>
+          <environment_variable action="set_to" name="SITE_PACKAGES_RELPATH">lib/python3.4/site-packages</environment_variable>
           <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
         </action>
       </actions>
@@ -86,10 +88,7 @@
       This means that **the pip installation tool will not be available with 
       this build** !! 
       
-      For a full build (including the ssl module) look at
-      https://toolshed.g2.bx.psu.edu/view/iuc/package_python_3_4/
-      issued by the IUC. 
-
+      
       This version of Python includes a built-in virtual environment manager. 
       To create a Python 3 virtual env, include the following actions in your 
       tool_dependencies.xml, e.g. for a package MY_TOOL_venv:
@@ -101,8 +100,7 @@
         &lt;!-- other install time dependencies --&gt;
       &lt;/action&gt;
 
-      &lt;action type="shell_command"&gt;        
-        
+      &lt;action type="shell_command"&gt;       
         # Create virtual environment MY_TOOL_venv
         # pip cannot be used for installation because it depends on ssl, 
         # which this build does not provide
@@ -117,7 +115,23 @@
         $INSTALL_DIR/MY_TOOL_venv/bin/python3 setup.py install 
       &lt;/action&gt;
       
-    For a full example look at the tool_dependencies file of:
+      &lt;action type="set_environment"&gt;
+        &lt;!-- prepend the bin directory of the virtual environment to PATH --&gt;
+        &lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt;
+        &lt;!-- prepend the site-packages directory of the virtual environment
+        to PYTHONPATH; using SITE_PACKAGES_RELPATH here makes it easy to migrate to 
+        a different version of Python --&gt;
+        &lt;environment_variable name="PYTHONPATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/$SITE_PACKAGES_RELPATH&lt;/environment_variable&gt;
+      &lt;/action&gt;
+      
+    Then, in your MY_TOOL.xml add the following requirements (in that order):
+
+      &lt;requirements&gt;
+        &lt;requirement name="package" version="3.4"&gt;python3&lt;/requirement&gt;
+        &lt;requirement name="package" version="XXX"&gt;MY_TOOL&lt;/requirement&gt;
+      &lt;/requirements&gt;
+      
+    For a concrete example look at the tool_dependencies file of:
     
         https://toolshed.g2.bx.psu.edu/view/wolma/mimodd