Mercurial > repos > jankanis > package_python3_4
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 && make install | 66 && 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 <action type="set_environment_for_install"> | 92 <action type="set_environment_for_install"> |
86 <repository name="python3" owner="jankanis"> | 93 <repository name="python3" owner="jankanis"> |
87 <package name="python3" version="3.4.1" /> | 94 <package name="python3" version="3.4.1" /> |
88 </repository> | 95 </repository> |
89 <!-- other install time dependencies --> | 96 <!-- other install time dependencies --> |
90 </action> | 97 </action> |
91 | 98 |
92 <action type="shell_command"> | 99 <action type="shell_command"> |
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 </action> | 108 </action> |
102 | 109 |
103 <action type="set_environment"> | 110 <action type="set_environment"> |
104 <!-- 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 <!-- Setting the PYTHONPATH correctly can be a bit tricky, because you must |
106 environments in the dependency hierarchy. --> | 113 make sure that the runtime PYTHONPATH from galaxy itself is not |
107 <environment_variable name="PYTHONPATH" action="set_to">$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages:$ENV[PYTHONPATH]</environment_variable> | 114 included, as it probably points to python 2 code that can crash a |
108 <!-- 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 --> | 116 |
110 <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/MY_TOOL_venv/bin</environment_variable> | 117 If you only use a single virtual environment that is created |
111 <!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --> | 118 specifically for a tool you are creating, you can just use a set_to |
112 <environment_variable name="PYTHONHOME" action="set_to"></environment_variable> | 119 like below. |
113 <!-- To find shared libraries for python built-in modules such as libssl or libsqlite3 | 120 |
114 we need to re-export LD_LIBRARY_PATH --> | 121 If you create a virtual environment installation that is meant to be |
115 <environment_variable name="LD_LIBRARY_PATH" action="prepend_to">$ENV[LD_LIBRARY_PATH]</environment_variable> | 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. --> | |
131 <environment_variable name="PYTHONPATH" action="set_to">$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages</environment_variable> | |
132 <!-- 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 --> | |
134 <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/MY_TOOL_venv/bin</environment_variable> | |
135 <!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --> | |
136 <environment_variable name="PYTHONHOME" action="set_to"></environment_variable> | |
137 <!-- To find shared libraries for python built-in modules such as libssl or libsqlite3 | |
138 we need to re-export LD_LIBRARY_PATH --> | |
139 <environment_variable name="LD_LIBRARY_PATH" action="prepend_to">$ENV[LD_LIBRARY_PATH]</environment_variable> | |
116 </action> | 140 </action> |
117 | 141 |
142 | |
143 Then, in your MY_TOOL.xml add the following requirement: | |
144 | |
145 <requirements> | |
146 <requirement name="package" version="XXX">MY_TOOL_venv</requirement> | |
147 </requirements> | |
148 | |
118 </readme> | 149 </readme> |
119 | 150 |
120 </package> | 151 </package> |
121 </tool_dependency> | 152 </tool_dependency> |