Repository 'package_python3_zlib_dependent_1_0'
hg clone https://toolshed.g2.bx.psu.edu/repos/wolma/package_python3_zlib_dependent_1_0

Changeset 0:1c337560fa56 (2014-12-13)
Next changeset 1:c322db44259d (2016-04-22)
Commit message:
Imported from capsule None
added:
tool_dependencies.xml
b
diff -r 000000000000 -r 1c337560fa56 tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml Sat Dec 13 17:19:12 2014 -0500
[
@@ -0,0 +1,98 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="zlib" version="1.2.8">
+      <repository changeset_revision="dce22a65bac2" name="package_zlib_1_2_8" owner="wolma" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+    <package name="python3" version="3.4.1">
+      <install version="1.0">
+          <actions>
+              <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action>
+                <action type="set_environment_for_install">
+                  <repository changeset_revision="dce22a65bac2" name="package_zlib_1_2_8" owner="wolma" toolshed="https://toolshed.g2.bx.psu.edu">
+                      <package name="zlib" version="1.2.8" />
+                    </repository>
+                </action>
+                <action type="shell_command">
+          # The python build system doesn't check CPATH / C(PLUS)_INCLUDE_PATH which is set by the depended-upon
+          # tool definitions for these sources, but it does check CPPFLAGS / LDFLAGS
+          # Currently not whitespace-safe, I haven't found a way yet to quote the *FLAGS values so that they are
+          # correctly recognized by both the python build process and the compiler. But as galaxy itself isn't
+          # whitespace-safe either it doesn't really matter (currently).
+          oldifs="$IFS"
+          IFS=":"
+          for p in $CPLUS_INCLUDE_PATH
+          do
+              CPPFLAGS="$CPPFLAGS -I$p"
+          done
+          for p in $LD_LIBRARY_PATH
+          do
+              LDFLAGS="$LDFLAGS -L$p"
+          done
+          IFS="$oldifs"
+          export CPPFLAGS
+          export LDFLAGS
+
+          # Clear variables that may be used in Galaxy's extenal python 2 environment
+          unset PYTHONPATH
+          unset PYTHONHOME
+
+          ./configure --prefix="$INSTALL_DIR" --with-ensurepip \
+          &amp;&amp; make \
+          &amp;&amp; make install
+        </action>
+                <action type="set_environment">
+                  <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+                    <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</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="PYTHONHOME">$INSTALL_DIR</environment_variable>
+                    <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
+                </action>
+            </actions>
+        </install>
+        <readme>
+      Python 3.4.1
+
+      The Python programming language version 3.
+
+      http://www.python.org
+
+
+      A lean build of python 3.4.1. It does not include modules with external dependencies except for the zlib module (handled in here by depending on package_zlib_1_2_8). 
+      
+      In particular, this build does not compile Python's ssl module, which would cause dependency on openssl and, in turn, on Perl. This means that **the pip installation tool will not be available with this build**. 
+      
+      For a build with more modules (and also ssl) included look at 
+      https://toolshed.g2.bx.psu.edu/view/jankanis/package_python3_4 
+      written by jankanis, of which this package is a shameless plagiarism. 
+
+      Python as of version 3.3 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:
+
+      &lt;action type="set_environment_for_install"&gt;
+        &lt;repository name="package_python3_zlib_dependent_1_0" owner="wolma"&gt;
+          &lt;package name="python3" version="3.4.1" /&gt;
+        &lt;/repository&gt;
+        &lt;!-- other install time dependencies --&gt;
+      &lt;/action&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
+        
+        pyvenv --without-pip $INSTALL_DIR/MY_TOOL_venv
+        
+        # install python packages
+        # assuming you are in the download directory of the package
+        
+        $INSTALL_DIR/MY_TOOL_venv/bin/python3 setup.py install 
+      &lt;/action&gt;
+      
+    For an example of how this could used by a package look at:
+    
+    https://testtoolshed.g2.bx.psu.edu/view/wolma/package_mimodd_0_1_5
+    
+    </readme>
+    </package>
+</tool_dependency>