view HowTo.md @ 4:ae4c301919c4 draft

planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy commit 2af2c8a0ca9665e1117bb7810bffc105ed39c4f5
author metexplore
date Thu, 17 Nov 2022 07:57:52 +0000
parents
children 7a6f2380fc1d
line wrap: on
line source

# How to build wrappers for new met4j-toolbox apps?

## Install planemo

```console
virtualenv --python=/usr/bin/python3.8 .venv;
source .venv/bin/activate
pip install planemo
```

## Install singularity

Doc [Here](https://github.com/sylabs/singularity/blob/main/INSTALL.md).

## Create new wrappers

1. Create a branch (e.g. newFeature) (or a new release) in met4j and develop your apps
2. Push the branch
3. If this branch is not master or develop, launch manually the 
building of the singularity image in the met4j CI-CD (this singularity image will be downloaded by the galaxy instance)
4. Create a branch with the same name in met4j-galaxy (e.g. newFeature)
5. Use the GenerateGalaxyFiles of the met4j-toolbox (be careful, it must be the version of the new branch) to generate the wrappers for the new met4j apps. Or you can use the singularity image created in the third step.

```console
met4j-toolbox.sif GenerateGalaxyFiles \
 -o /path/to/met4j-galaxy/tools \
 -v newFeature

```

Where newFeature is the name of the new branch.

6. Edit manually the wrappers where the tests are lacking.

[Here](https://docs.galaxyproject.org/en/latest/dev/schema.html#tool-tests) is the documentation about tests in galaxy

Put the test files in a test-data directory in the tool directory.
If the file is used in several tests, put it in the data directory at the root of the project and create a symbolic link in the test-data directory.

7. Check the syntax of the wrappers

```console
source .venv/bin/activate
planemo shed_lint --tools \
--ensure_metadata \
--urls \
--report_level warn \
--fail_level error \
--recursive tools
```

8. Launch the tests

Launching all the tests can be very time consuming. 

You can launch the test for one tool (here convert.Sbml2Graph):

```console
source .venv/bin/activate
planemo test \
--galaxy_source https://github.com/galaxyproject/galaxy \
--galaxy_branch release_22.01 \
--job_config_file config/job_conf.xml \
tools/convert/Sbml2Graph/
```

or for an entire package (here convert):

```console
source .venv/bin/activate
planemo test \
--galaxy_source https://github.com/galaxyproject/galaxy \
--galaxy_branch release_22.01 \
--job_config_file config/job_conf.xml \
tools/convert/Sbml2Graph/
```

If you want to test all the tools:

```console
source .venv/bin/activate
planemo test \
--galaxy_source https://github.com/galaxyproject/galaxy \
--galaxy_branch release_22.01 \
--job_config_file config/job_conf.xml
```

The results of the tests can be read in tool_test_output.html.

9. If all the tests are ok, merge the new met4j branch in develop
10. Create a new met4j release and finish the release: it will create a new singularity image for this version
11. Launch once again GenerateGalaxyFiles

```console
met4j-toolbox.sif GenerateGalaxyFiles \
 -o /path/to/met4j-galaxy/tools \
 -v 1.1.1
```

where 1.1.1 is the number of the new release

12. In met4j-galaxy, launch planemo lint to check if there is app without test and if everything is ok
13. Test all the tools 
14. Merge on develop, create a new release, and push

This will test again all the tools on the gitlab CI/CD. If it's ok, a new version of met4j-galaxy will be pushed on the galaxy toolshed. The instance in usegalaxy.fr will be updated the next monday.