galaxyproject/planemo — pull request #33 by jmchilton (2014-12-05 05:07:18+00:00)
Title: Implement shed_diff.

Inspired by script from @peterjc - https://gist.github.com/peterjc/13653e6907d75c470d01.

By default compares the local changes against the main Tool Shed repository defined by [.][tool][_]shed.yml, but with command line options can be made to do all sorts of comparisons. Some of these are demonstrated below:

Default against main tool shed:

```
% planemo shed_diff
wget -q --recursive -O - 'https://toolshed.g2.bx.psu.edu/repository/download?repository_id=b6b97c236de89252&changeset_revision=default&file_type=gz'; | tar -xzf - -C /tmp/tool_shed_diff_CuRq5U/_toolshed_ --strip-components 1
mkdir "/tmp/tool_shed_diff_CuRq5U/_local_"; tar -xzf "/tmp/tmpdVW07c" -C "/tmp/tool_shed_diff_CuRq5U/_local_"; rm -rf /tmp/tmpdVW07c
cd "/tmp/tool_shed_diff_CuRq5U"; diff -r _local_ _toolshed_
diff -r _local_/count_covariates.xml _toolshed_/count_covariates.xml
7d6
< echo "A REALLY OLD OPEN SOURCE VERSION OF GATK"
diff -r _local_/tool_dependencies.xml _toolshed_/tool_dependencies.xml
4c4
<
---
>
7c7
<
---
>
```

Check local diff against test tool shed.

```
% planemo shed_diff --shed_target testtoolshed
/home/john/workspace/planemo/.venv/local/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/packages/urllib3/connectionpool.py:730: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html (This warning will only appear once by default.)
InsecureRequestWarning)
wget -q --recursive -O - 'https://testtoolshed.g2.bx.psu.edu/repository/download?repository_id=4dd15c58c2ade087&changeset_revision=default&file_type=gz'; | tar -xzf - -C /tmp/tool_shed_diff_LWnNZt/_testtoolshed_ --strip-components 1
mkdir "/tmp/tool_shed_diff_LWnNZt/_local_"; tar -xzf "/tmp/tmpNKEpuO" -C "/tmp/tool_shed_diff_LWnNZt/_local_"; rm -rf /tmp/tmpNKEpuO
cd "/tmp/tool_shed_diff_LWnNZt"; diff -r _local_ _testtoolshed_
diff -r _local_/count_covariates.xml _testtoolshed_/count_covariates.xml
7d6
< echo "A REALLY OLD OPEN SOURCE VERSION OF GATK"
diff -r _local_/tool_dependencies.xml _testtoolshed_/tool_dependencies.xml
4c4
<
---
>
7c7
<
---
>
```

Check difference between test and main for this repository.

```
% planemo shed_diff --shed_target_source testtoolshed
/home/john/workspace/planemo/.venv/local/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/packages/urllib3/connectionpool.py:730: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html (This warning will only appear once by default.)
InsecureRequestWarning)
wget -q --recursive -O - 'https://toolshed.g2.bx.psu.edu/repository/download?repository_id=b6b97c236de89252&changeset_revision=default&file_type=gz'; | tar -xzf - -C /tmp/tool_shed_diff_Aa9wj3/_toolshed_ --strip-components 1
wget -q --recursive -O - 'https://testtoolshed.g2.bx.psu.edu/repository/download?repository_id=4dd15c58c2ade087&changeset_revision=default&file_type=gz'; | tar -xzf - -C /tmp/tool_shed_diff_Aa9wj3/_testtoolshed_ --strip-components 1
cd "/tmp/tool_shed_diff_Aa9wj3"; diff -r _testtoolshed_ _toolshed_
diff -r _testtoolshed_/tool_dependencies.xml _toolshed_/tool_dependencies.xml
4c4
<
---
>
7c7
<
---
>
```

Ignore YAML file and just check difference between main and test tool shed for arbitrary repository.

```
% planemo shed_diff --owner peterjc --name blast_rbh --shed_target_source testtoolshed
/home/john/workspace/planemo/.venv/local/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/packages/urllib3/connectionpool.py:730: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html (This warning will only appear once by default.)
InsecureRequestWarning)
wget -q --recursive -O - 'https://toolshed.g2.bx.psu.edu/repository/download?repository_id=d5dd1c5d2070513e&changeset_revision=default&file_type=gz'; | tar -xzf - -C /tmp/tool_shed_diff_II0eAD/_toolshed_ --strip-components 1
wget -q --recursive -O - 'https://testtoolshed.g2.bx.psu.edu/repository/download?repository_id=c053d26daf6271bf&changeset_revision=default&file_type=gz'; | tar -xzf - -C /tmp/tool_shed_diff_II0eAD/_testtoolshed_ --strip-components 1
cd "/tmp/tool_shed_diff_II0eAD"; diff -r _testtoolshed_ _toolshed_
diff -r _testtoolshed_/tools/blast_rbh/blast_rbh.py _toolshed_/tools/blast_rbh/blast_rbh.py
35c35
< print "BLAST RBH v0.1.6"
---
> print "BLAST RBH v0.1.5"
110c110
< if blast_type not in ["blastp", "blastp-fast", "blastp-short"]:
---
> if blast_type not in ["blastp", "blastp-short"]:
332c332
< sys.stderr.write("Warning: Sequences with tied best hits found, you may have duplicates/clusters\n")
---
> sys.stderr.write("Warning: Sequencies with tied best hits found, you may have duplicates/clusters\n")
diff -r _testtoolshed_/tools/blast_rbh/blast_rbh.xml _toolshed_/tools/blast_rbh/blast_rbh.xml
1c1
<
---
>
48d47
<
blastp-fast - Uses longer words as described by Shiryev et al (2007)

167c166
<
---
>
diff -r _testtoolshed_/tools/blast_rbh/README.rst _toolshed_/tools/blast_rbh/README.rst
65d64
< v0.1.6 - Offer the new blastp-fast task added in BLAST+ 2.2.30.
diff -r _testtoolshed_/tools/blast_rbh/tool_dependencies.xml _toolshed_/tools/blast_rbh/tool_dependencies.xml
4c4
<
---
>
7c7
<
---
>
```

Closes #27.