Skip to content

Commit

Permalink
MAINT: Updates for python 3.6 (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
thermokarst committed Jan 15, 2019
1 parent dd47374 commit 5d5b42f
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendor/sepp-refs"]
path = vendor/sepp-refs
url = https://github.com/smirarab/sepp-refs.git
34 changes: 34 additions & 0 deletions ci/recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

set -e
set -x

# extract Silva reference files
tar xjvf vendor/sepp-refs/silva/sepp-package-silva.tar.bz sepp-package-silva/ref/
tar xjvf vendor/sepp-refs/silva/sepp-package-silva-2.tar.bz sepp-package-silva/ref/
tar xjvf vendor/sepp-refs/gg/sepp-package.tar.bz sepp-package/

mv sepp-package-silva/ref/reference-99_otus_aligned_masked1977.fasta-rooted.tre sepp-package/ref/silva12.8_99otus_aligned_masked1977.tre
mv sepp-package-silva/ref/RAxML_info.99_otus_aligned_masked1977.fasta sepp-package/ref/silva12.8_99otus_aligned_masked1977.info
mv sepp-package-silva/ref/99_otus_aligned_masked1977.fasta sepp-package/ref/silva12.8_99otus_aligned_masked1977.fasta

if [ "$(uname)" == "Darwin" ]; then
rm -rf sepp-package/sepp/tools/bundled/Linux
fi

# we have an indent error in one of the sepp python source files, which gets fixed here
patch sepp-package/sepp/sepp/algorithm.py < indent.patch

# change DIR in SEPP wrapper to be relocatable
patch sepp-package/run-sepp.sh < reloc.patch
mkdir -p $PREFIX/share/
mv sepp-package $PREFIX/share/fragment-insertion

# configure SEPP
cd $PREFIX/share/fragment-insertion/sepp/ && python setup.py config -c ; cd -
# move SEPP binary into PREFIX/bin and update reference location
mkdir -p $PREFIX/bin/
mv $PREFIX/share/fragment-insertion/run-sepp.sh $PREFIX/bin
cp `cat $PREFIX/share/fragment-insertion/sepp/.sepp/main.config | grep "^path" -m 1 | cut -d "=" -f 2 | xargs dirname`/* $PREFIX/bin/

cp taxonomy_gg99.qza $PREFIX/share/fragment-insertion/ref/ && make install
2 changes: 2 additions & 0 deletions ci/recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python:
- 3.6
11 changes: 11 additions & 0 deletions ci/recipe/indent.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- algorithm.py 2018-06-19 14:19:06.000000000 -0700
+++ algorithm.py.fixindent 2018-06-19 23:59:22.910273892 -0700
@@ -259,7 +259,7 @@
"ut fragments and re-start. Duplicate names are:\n '%s'") %
(len(ids_overlap), "'\n '".join(ids_overlap)))

- for (k,v) in extra_frags.items():
+ for (k,v) in extra_frags.items():
self.root_problem.fragments[k] = v.replace("-","")
alg_chunks = self.root_problem.fragments.divide_to_equal_chunks(chunks, max_chunk_size)
ret = []
19 changes: 9 additions & 10 deletions ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ package:
version: {{ version }}

source:
path: ../..

build:
script: cp taxonomy_gg99.qza $PREFIX/share/fragment-insertion/ref/ && make install
- path: ../..
# Not using the built-in patching mechanism of conda-build, since we aren't
# actually patching q2-fragment-insertion, but rather sepp-refs.
- path: reloc.patch
- path: indent.patch

requirements:
build:
- python 3.5*
- python {{ python }}
- setuptools
# Need this in build so that the ref path above exists
- fragment-insertion >=4.3.5
- java-jdk

run:
- python 3.5*
- setuptools
- fragment-insertion >=4.3.5
- python {{ python }}
- java-jdk
- biom-format >=2.1.5,<2.2.0
- qiime2 {{ release }}.*
- q2-types {{ release }}.*
Expand Down
11 changes: 11 additions & 0 deletions ci/recipe/reloc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- run-sepp.sh 2018-06-19 14:19:06.000000000 -0700
+++ run-sepp.sh.reloc 2018-06-20 00:01:16.570464485 -0700
@@ -107,7 +107,7 @@
done


-DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+DIR=/opt/anaconda1anaconda2anaconda3/share/fragment-insertion/

# Reference tree
if [ -z $t ]; then
9 changes: 9 additions & 0 deletions ci/recipe/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -x
set -e

# test if new Silva reference files are copied to the right location
ls $PREFIX/share/fragment-insertion/ref/silva12.8_99otus_aligned_masked1977.tre
ls $PREFIX/share/fragment-insertion/ref/silva12.8_99otus_aligned_masked1977.info
ls $PREFIX/share/fragment-insertion/ref/silva12.8_99otus_aligned_masked1977.fasta
1 change: 1 addition & 0 deletions vendor/sepp-refs
Submodule sepp-refs added at ed8a8a

0 comments on commit 5d5b42f

Please sign in to comment.