Mercurial > repos > wolma > package_python_3_4_x_lean
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 @@ <!-- other install time dependencies --> </action> - <action type="shell_command"> - + <action type="shell_command"> # 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 </action> - For a full example look at the tool_dependencies file of: + <action type="set_environment"> + <!-- prepend the bin directory of the virtual environment to PATH --> + <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/MY_TOOL_venv/bin</environment_variable> + <!-- 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 --> + <environment_variable name="PYTHONPATH" action="prepend_to">$INSTALL_DIR/MY_TOOL_venv/$SITE_PACKAGES_RELPATH</environment_variable> + </action> + + Then, in your MY_TOOL.xml add the following requirements (in that order): + + <requirements> + <requirement name="package" version="3.4">python3</requirement> + <requirement name="package" version="XXX">MY_TOOL</requirement> + </requirements> + + For a concrete example look at the tool_dependencies file of: https://toolshed.g2.bx.psu.edu/view/wolma/mimodd