Hi Matthias,

you need to add something like the following to your tool defintion:

<requirements>
   <requirement type="package" version="1.1p1">chemfp</requirement>
</requirements>

The version and the name needs to be the same as in your tool_dependency.xml.

Cheers,
Bjoern


Björn,

I have galaxy-dist. Was it the right choice?

Here is what I did. I copied your "tool_dependencies.xml" into my project 
(s_mart, in the test Tool Shed), and I created a testing XML file, which 
uses your dependencies:
---
<tool id="test" name="test">
        <description>This is a test.</description>
     <requirements>
         <requirement type="set_environment">PYTHONPATH</requirement>
         <requirement type="set_environment">PATH</requirement>
     </requirements>
        <requirement type="package" version="1.7.1">numpy</requirement>
        <command>env > $outputFile;  python -c "import numpy" >> 
$outputFile</command>
        <outputs>
                <data name="outputFile" format="txt" label="output test 
file"/>
        </outputs>
     <help>This is a test.</help>
</tool>
---
I uninstall and reinstall the package, then run the test. Numpy seems fine 
(I got no complain), but PYTHONPATH and PATH are not updated.

I change "append_to" and "prepend_to" to "set_to" in the 
"tool_dependencies.xml". I unstall/reinstall my package... the variable 
dependencies have disappeared! When I run the test, the environment 
variables are left unchanged.

It seems now that Galaxy may have some problems with the reinstall. I 
tried to totally install my package, but Galaxy remembers having seen it 
and reinstalls it instead of a fresh install.

Could this be the source of the problem?

Matthias.


On Wed, 24 Apr 2013, Björn Grüning wrote:

> Hi Matthias,
>
>> Sure,
>>
>> This is the least I can do. However, I do not know how to install a
>> package from a simple XML, and without Tool Shed installed repository.
>
> it's documented here:
> http://wiki.galaxyproject.org/Tool%
> 20Shed#Installing.2C_maintaining_and_uninstalling_tool_shed_repositories_within_a_Galaxy_instance
>
>> I will check that.
>> I have downloaded Galaxy for installation less than a week ago.
>
> Have you downloaded galaxy-dist or galaxy-central?
>
> Cheers,
> Bjoern
>
>> Matthias.
>>
>>
>> On Wed, 24 Apr 2013, Björn Grüning wrote:
>>
>>> Hi Matthias,
>>>
>>> do you use the toolshed or the testtoolshed?
>>> Can you please test the following repo and install:
>>>
>>> testtoolshed.g2.bx.psu.edu/repos/bgruening/package_numpy_1_7
>>>
>>> It also contains append_to and works for me. Also which version of
>>> galaxy do you use?
>>>
>>> Thanks!
>>> Bjoern
>>>
>>>> Dear everyone,
>>>>
>>>> I finally got the answer. The "append_to" does not seem do work in the
>>>> "tool_dependencies.xml":
>>>>
>>>> ---
>>>> <environment_variable name="PYTHONPATH"
>>>> action="append_to">$REPOSITORY_INSTALL_DIR</environment_variable>
>>>> ---
>>>> does not insert anything, while:
>>>> ---
>>>> <environment_variable name="PYTHONPATH"
>>>> action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
>>>> ---
>>>> updates the correct "env.sh" and "INSTALLATION.log" files.
>>>>
>>>> Weird.
>>>>
>>>> Many thanks for your help.
>>>>
>>>> Matthias.
>>>>
>>>>
>>>> On Tue, 23 Apr 2013, Björn Grüning wrote:
>>>>
>>>>> Hi Matthias,
>>>>>
>>>>>> Dear Björn,
>>>>>> Maybe the problem is here. I cannot find neither "tool_deps", nor
>>>>>> "env.sh".
>>>>>> The install is fresh from yesterday... I should check why I did not
>>>>>> generate these files.
>>>>>> By the way, if "env.sh" is sourced right before my script, I should see
>>>>>> the updated PYTHONPATH in the result of the command "env > $outputFile",
>>>>>> no?
>>>>>
>>>>> Yes :)
>>>>> The tool_deps directory is set in universe_wsgi.ini under:
>>>>> tool_dependency_dir = ./tool_deps/
>>>>>
>>>>> Ciao,
>>>>> Bjoern
>>>>>
>>>>>> Many thanks,
>>>>>> Matthias.
>>>>>>
>>>>>>
>>>>>> On Tue, 23 Apr 2013, Björn Grüning wrote:
>>>>>>
>>>>>>> Hi Matthias,
>>>>>>>
>>>>>>> PYTHONPATH will not be changed globally.
>>>>>>> It's only changed during execution of your tool.
>>>>>>> Have a look under ./tool_deps/.../.../.../s_mart/ there is a file called
>>>>>>> env.sh with your PYTHONPATH.
>>>>>>> That file is executed before your command
>>>>>>>
>>>>>>> <command>env > $outputFile</command>
>>>>>>>
>>>>>>> is executed.
>>>>>>> Hope that helps,
>>>>>>> Bjoern
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Dear everyone,
>>>>>>>>
>>>>>>>> I have spent hours trying to set environment variable in Galaxy. I am
>>>>>>>> managing the "s_mart" repos (you can check it if you wish), and I created
>>>>>>>> the simple files "test.xml" which prints the environment variables:
>>>>>>>> ---
>>>>>>>> <tool id="test" name="test">
>>>>>>>>      <description>This is a test.</description>
>>>>>>>>      <requirements>
>>>>>>>>          <requirement type="set_environment">PYTHONPATH</requirement>
>>>>>>>>      </requirements>
>>>>>>>>      <command>env > $outputFile</command>
>>>>>>>>      <outputs>
>>>>>>>>              <data name="outputFile" format="txt" label="output test
>>>>>>>> file"/>
>>>>>>>>      </outputs>
>>>>>>>>      <help>This is a test.</help>
>>>>>>>> </tool>
>>>>>>>> ---
>>>>>>>>
>>>>>>>> and "tool_dependencies.xml", which appends something to the PYTHONPATH
>>>>>>>> variable.:
>>>>>>>> ---
>>>>>>>> <?xml version="1.0"?>
>>>>>>>> <tool_dependency>
>>>>>>>>      <set_environment version="1.0">
>>>>>>>>          <environment_variable name="PYTHONPATH"
>>>>>>>> action="append_to">$REPOSITORY_INSTALL_DIR</environment_variable>
>>>>>>>>      </set_environment>
>>>>>>>> </tool_dependency>
>>>>>>>> ---
>>>>>>>> As you guess, I cannot see anything added in the PYTHONPATH variable. I
>>>>>>>> have tried to append INSTALL_DIR and even "/tmp". None worked.
>>>>>>>>
>>>>>>>> Do you have any suggestion for me?
>>>>>>>>
>>>>>>>> Many thanks to you all,
>>>>>>>>
>>>>>>>> Matthias.
>>>>>>>> ___________________________________________________________
>>>>>>>> Please keep all replies on the list by using "reply all"
>>>>>>>> in your mail client.  To manage your subscriptions to this
>>>>>>>> and other Galaxy lists, please use the interface at:
>>>>>>>>   http://lists.bx.psu.edu/
>>>>>>>>
>>>>>>>> To search Galaxy mailing lists use the unified search at:
>>>>>>>>   http://galaxyproject.org/search/mailinglists/
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>
> -- 
> Björn Grüning
> Albert-Ludwigs-Universität Freiburg
> Institute of Pharmaceutical Sciences
> Pharmaceutical Bioinformatics
> Hermann-Herder-Strasse 9
> D-79104 Freiburg i. Br.
>
> Tel.:  +49 761 203-4872
> Fax.:  +49 761 203-97769
> E-Mail: bjoern.gruening@pharmazie.uni-freiburg.de
> Web: http://www.pharmaceutical-bioinformatics.org/
>
>