comparison tool_dependencies.xml @ 17:d30e6a97dfbf draft default tip

add dependency on zlib
author jankanis
date Wed, 28 May 2014 10:44:03 -0400
parents 7719329e5b98
children
comparison
equal deleted inserted replaced
16:7719329e5b98 17:d30e6a97dfbf
1 <?xml version="1.0"?> 1 <?xml version="1.0"?>
2 <tool_dependency> 2 <tool_dependency>
3 <package name="openssl" version="1.0.1g"> 3 <package name="openssl" version="1.0.1g">
4 <repository changeset_revision="3b19041c651c" name="package_openssl_1_0" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" /> 4 <repository changeset_revision="3b19041c651c" name="package_openssl_1_0" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
5 </package>
6
7 <package name="zlib" version="1.2.8">
8 <repository changeset_revision="31f1e69aae89" name="package_zlib_1_2_8" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
5 </package> 9 </package>
6 10
7 <package name="sqlite" version="3.8.3"> 11 <package name="sqlite" version="3.8.3">
8 <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" /> 12 <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
9 </package> 13 </package>
17 <install version="1.0"> 21 <install version="1.0">
18 <actions> 22 <actions>
19 <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action> 23 <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action>
20 24
21 <action type="set_environment_for_install"> 25 <action type="set_environment_for_install">
26 <repository changeset_revision="31f1e69aae89" name="package_zlib_1_2_8" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
27 <package name="zlib" version="1.2.8" />
28 </repository>
22 <repository changeset_revision="3b19041c651c" name="package_openssl_1_0" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu"> 29 <repository changeset_revision="3b19041c651c" name="package_openssl_1_0" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
23 <package name="openssl" version="1.0.1g" /> 30 <package name="openssl" version="1.0.1g" />
24 </repository> 31 </repository>
25 <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu"> 32 <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
26 <package name="sqlite" version="3.8.3" /> 33 <package name="sqlite" version="3.8.3" />
59 &amp;&amp; make install 66 &amp;&amp; make install
60 </action> 67 </action>
61 68
62 <action type="set_environment"> 69 <action type="set_environment">
63 <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable> 70 <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
64 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</environment_variable> 71 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</environment_variable>
65 <!-- empty PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path --> 72 <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
66 <environment_variable action="set_to" name="PYTHONPATH" /> 73 <environment_variable action="set_to" name="PYTHONPATH" />
67 <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable> 74 <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
68 <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable> 75 <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
69 </action> 76 </action>
70 </actions> 77 </actions>
78 http://www.python.org 85 http://www.python.org
79 86
80 87
81 This build of python is configured with --enable-loadable-sqlite-extensions, any other settings are default. This build does not include modules for lzma and Tkinter, but does include ssl, (g)dbm and sqlite. Adding the missing modules should not be very difficult but requires wrapping the external sources that these modules require inside galaxy. 88 This build of python is configured with --enable-loadable-sqlite-extensions, any other settings are default. This build does not include modules for lzma and Tkinter, but does include ssl, (g)dbm and sqlite. Adding the missing modules should not be very difficult but requires wrapping the external sources that these modules require inside galaxy.
82 89
83 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: 90 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:
84 91
85 &lt;action type="set_environment_for_install"&gt; 92 &lt;action type="set_environment_for_install"&gt;
86 &lt;repository name="python3" owner="jankanis"&gt; 93 &lt;repository name="python3" owner="jankanis"&gt;
87 &lt;package name="python3" version="3.4.1" /&gt; 94 &lt;package name="python3" version="3.4.1" /&gt;
88 &lt;/repository&gt; 95 &lt;/repository&gt;
89 &lt;!-- other install time dependencies --&gt; 96 &lt;!-- other install time dependencies --&gt;
90 &lt;/action&gt; 97 &lt;/action&gt;
91 98
92 &lt;action type="shell_command"&gt; 99 &lt;action type="shell_command"&gt;
93 # Unset any saved environment settings from parent virtual 100 # Unset any saved environment settings from parent virtual
94 # environments, e.g. for python 2 or if Galaxy itself is running 101 # environments, e.g. for python 2 or if Galaxy itself is running
95 # from within a virtual environment. 102 # from within a virtual environment.
96 unset _OLD_VIRTUAL_PATH; unset _OLD_VIRTUAL_PYTHONHOME 103 unset _OLD_VIRTUAL_PATH; unset _OLD_VIRTUAL_PYTHONHOME
97 # Create virtual environment MY_TOOL_venv 104 # Create virtual environment MY_TOOL_venv
98 pyvenv MY_TOOL_venv 105 pyvenv MY_TOOL_venv
99 # install python packages 106 # install python packages
100 MY_TOOL_venv/bin/pip3 install {{NEEDED_PYTHON_PACKAGES}} 107 MY_TOOL_venv/bin/pip3 install {{NEEDED_PYTHON_PACKAGES}}
101 &lt;/action&gt; 108 &lt;/action&gt;
102 109
103 &lt;action type="set_environment"&gt; 110 &lt;action type="set_environment"&gt;
104 &lt;!-- Remove any incoming PYTHONPATH elements from Galaxy's own python 2 environment, 111
105 but include an existing install time PYTHONPATH (e.g. from other python3 virtual 112 &lt;!-- Setting the PYTHONPATH correctly can be a bit tricky, because you must
106 environments in the dependency hierarchy. --&gt; 113 make sure that the runtime PYTHONPATH from galaxy itself is not
107 &lt;environment_variable name="PYTHONPATH" action="set_to"&gt;$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages:$ENV[PYTHONPATH]&lt;/environment_variable&gt; 114 included, as it probably points to python 2 code that can crash a
108 &lt;!-- All that is really needed to use a specific virtual environment is that the 115 program if python 3 tries to load it.
109 python interpreter in that environment is used, so add it to PATH --&gt; 116
110 &lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt; 117 If you only use a single virtual environment that is created
111 &lt;!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --&gt; 118 specifically for a tool you are creating, you can just use a set_to
112 &lt;environment_variable name="PYTHONHOME" action="set_to"&gt;&lt;/environment_variable&gt; 119 like below.
113 &lt;!-- To find shared libraries for python built-in modules such as libssl or libsqlite3 120
114 we need to re-export LD_LIBRARY_PATH --&gt; 121 If you create a virtual environment installation that is meant to be
115 &lt;environment_variable name="LD_LIBRARY_PATH" action="prepend_to"&gt;$ENV[LD_LIBRARY_PATH]&lt;/environment_variable&gt; 122 reused by other packages, the virtual environment should probably
123 prepend its site-packages to the PYTHONPATH since a tool could be
124 using python modules from several virtual environments. But in such a
125 scenario the tool that uses these virtual environments should also
126 depend directly on the python3 package, and this dependency should be
127 listed before any virtual environment dependencies. This ensures that
128 the python3 environment settings that clear PYTHONPATH are sourced
129 first so galaxy's runtime PYTHONPATH is excluded. Virtual environments
130 can then prepend their PYTHONPATHs to each other. --&gt;
131 &lt;environment_variable name="PYTHONPATH" action="set_to"&gt;$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages&lt;/environment_variable&gt;
132 &lt;!-- All that is really needed to use a specific virtual environment is that the
133 python interpreter in that environment is used, so add it to PATH --&gt;
134 &lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt;
135 &lt;!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --&gt;
136 &lt;environment_variable name="PYTHONHOME" action="set_to"&gt;&lt;/environment_variable&gt;
137 &lt;!-- To find shared libraries for python built-in modules such as libssl or libsqlite3
138 we need to re-export LD_LIBRARY_PATH --&gt;
139 &lt;environment_variable name="LD_LIBRARY_PATH" action="prepend_to"&gt;$ENV[LD_LIBRARY_PATH]&lt;/environment_variable&gt;
116 &lt;/action&gt; 140 &lt;/action&gt;
117 141
142
143 Then, in your MY_TOOL.xml add the following requirement:
144
145 &lt;requirements&gt;
146 &lt;requirement name="package" version="XXX"&gt;MY_TOOL_venv&lt;/requirement&gt;
147 &lt;/requirements&gt;
148
118 </readme> 149 </readme>
119 150
120 </package> 151 </package>
121 </tool_dependency> 152 </tool_dependency>