[med-svn] [Git][med-team/covpipe][master] Try hard do get at least a vague idea how a test could be run.

Andreas Tille gitlab at salsa.debian.org
Thu Mar 25 20:42:16 GMT 2021



Andreas Tille pushed to branch master at Debian Med / covpipe


Commits:
dd8b2601 by Andreas Tille at 2021-03-25T21:41:39+01:00
Try hard do get at least a vague idea how a test could be run.

- - - - -


7 changed files:

- debian/changelog
- debian/control
- + debian/patches/no_conda_for_tests.patch
- + debian/patches/python3.patch
- + debian/patches/series
- debian/rules
- debian/tests/control → debian/tests/control_deactivated


Changes:

=====================================
debian/changelog
=====================================
@@ -1,5 +1,6 @@
 covpipe (3.0.3-1) UNRELEASED; urgency=medium
 
   * Initial release (Closes: #<bug>)
+  TODO: pangolin (https://salsa.debian.org/med-team/pangolin)
 
  -- Andreas Tille <tille at debian.org>  Thu, 25 Mar 2021 16:20:35 +0100


=====================================
debian/control
=====================================
@@ -6,7 +6,10 @@ Priority: optional
 Build-Depends: debhelper-compat (= 13),
                dh-python,
                python3,
-               python3-setuptools
+               python3-setuptools,
+               python3-biopython <!nocheck>,
+               python3-pandas <!nocheck>,
+               python3-yaml <!nocheck>
 Standards-Version: 4.5.1
 Vcs-Browser: https://salsa.debian.org/med-team/covpipe
 Vcs-Git: https://salsa.debian.org/med-team/covpipe.git
@@ -16,7 +19,10 @@ Rules-Requires-Root: no
 Package: covpipe
 Architecture: all
 Depends: ${python3:Depends},
-         ${misc:Depends}
+         ${misc:Depends},
+         snakemake,
+         python3-pysam,
+         python3-biopython
 Description: pipeline to generate consensus sequences from NGS reads
  CovPipe is a pipeline to generate consensus sequences from NGS reads
  based on a reference sequence. The pipeline is tailored to be used for


=====================================
debian/patches/no_conda_for_tests.patch
=====================================
@@ -0,0 +1,82 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Thu, 25 Mar 2021 16:20:35 +0100
+Description: Try running without conda
+
+--- a/tests/quicktest.sh
++++ b/tests/quicktest.sh
+@@ -6,7 +6,7 @@ eecho(){
+     echo $@ 1>&2
+ }
+ 
+-if ! which activate > /dev/null ; then
++if ! which cat > /dev/null ; then
+     printf "%s\n"\
+        "Errro Encountered: You are currently in an active conda environment"\
+        " You need to either leave the environment and run this script again,"\
+@@ -23,14 +23,14 @@ if ! type -a realpath > /dev/null; then
+     }
+ fi
+ 
+-CONDA_ACTIVATE="$(which activate)"
++CONDA_ACTIVATE=""
+ CONDA_ACTIVE=0
+ 
+ 
+ activate_conda(){
+     echo $@
+     set +ue
+-    source "$CONDA_ACTIVATE" --stack "$@"
++    echo source "$CONDA_ACTIVATE" --stack "$@"
+     set -ue
+     CONDA_ACTIVE=$((CONDA_ACTIVE+1))
+     echo CONDA ENVIRONMENTS "$CONDA_ACTIVE"
+@@ -38,7 +38,7 @@ activate_conda(){
+ 
+ deactivate_conda(){
+     set +ue
+-    conda deactivate
++    echo conda deactivate
+     set -ue
+     CONDA_ACTIVE=$((CONDA_ACTIVE-1))
+     echo ACTIVE CONDA ENVIRONMENTS $CONDA_ACTIVE
+@@ -58,9 +58,6 @@ main(){
+     local PROXY=""
+     snake_args=( "" ) 
+ 	local covpipe_package_exists=0
+-	if conda list | grep covpipe ; then
+-		covpipe_package_exists=1
+-	fi  
+ 	
+ 	local USE_MAMBA=0
+ 	if command -v mamba > /dev/null 2>&1; then
+--- a/ncov_minipipe.conda.setup/setup_env.sh
++++ b/ncov_minipipe.conda.setup/setup_env.sh
+@@ -46,7 +46,7 @@ cp_if_file_exists(){
+ }
+ 
+ update_conda_or_install(){
+-    $CONDA_FRONTEND install \
++    echo $CONDA_FRONTEND install \
+         -c conda-forge  -c bioconda -c defaults \
+         "python>=3.6.0" \
+         "snakemake>=5.26" \
+@@ -66,12 +66,12 @@ cp "${ENV_SETUP}/d.env_vars.sh" "${DPATH
+ 
+ # Customization
+ 
+-set +uEe
+-. activate "${ENVPATH}/"
+-set -uEe
+-python -m pip install "${DEV_MODE}" "${SNAKE_DIR}"
+-set +uEe
+-conda deactivate
+-set -uEe
++#set +uEe
++#. activate "${ENVPATH}/"
++#set -uEe
++#python -m pip install "${DEV_MODE}" "${SNAKE_DIR}"
++#set +uEe
++#conda deactivate
++#set -uEe
+ stop_setup
+ 


=====================================
debian/patches/python3.patch
=====================================
@@ -0,0 +1,80 @@
+--- a/hash.py
++++ b/hash.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ 
+ # hoelzerm at rki.de
+ 
+--- a/ncov_minipipe.conda.setup/env_setup/gb2fasta_gff.py
++++ b/ncov_minipipe.conda.setup/env_setup/gb2fasta_gff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ # Copyright 2013-2014 Mitchell Stanton-Cook Licensed under the
+ # Educational Community License, Version 2.0 (the "License"); you may
+--- a/covpipe/ncov_minipipe.py
++++ b/covpipe/ncov_minipipe.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ from __future__ import print_function
+ from sys import version_info
+--- a/covpipe_tools/update_pangolin.py
++++ b/covpipe_tools/update_pangolin.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ import argparse
+ import os
+ import re
+--- a/tests/TestData/References/search_ncbi_nuc.py
++++ b/tests/TestData/References/search_ncbi_nuc.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ from Bio import Entrez
+ import argparse
+--- a/tests/TestData/VCF_FILES/generate_vcf.py
++++ b/tests/TestData/VCF_FILES/generate_vcf.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ import os
+ import sys
+--- a/tests/development_envs/setups/genbank2fasta.setup/env_setup/gb2fasta_gff.py
++++ b/tests/development_envs/setups/genbank2fasta.setup/env_setup/gb2fasta_gff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ # Copyright 2013-2014 Mitchell Stanton-Cook Licensed under the
+ # Educational Community License, Version 2.0 (the "License"); you may
+--- a/tests/development_envs/setups/mummer.setup/env_setup/gb2fasta_gff.py
++++ b/tests/development_envs/setups/mummer.setup/env_setup/gb2fasta_gff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ # Copyright 2013-2014 Mitchell Stanton-Cook Licensed under the
+ # Educational Community License, Version 2.0 (the "License"); you may
+--- a/tests/development_envs/setups/testDev.setup/env_setup/gb2fasta_gff.py
++++ b/tests/development_envs/setups/testDev.setup/env_setup/gb2fasta_gff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ # Copyright 2013-2014 Mitchell Stanton-Cook Licensed under the
+ # Educational Community License, Version 2.0 (the "License"); you may
+--- a/tests/run_art.py
++++ b/tests/run_art.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ import os
+ import sys


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+no_conda_for_tests.patch
+python3.patch


=====================================
debian/rules
=====================================
@@ -5,10 +5,9 @@
 
 override_dh_fixperms:
 	dh_fixperms
-	find debian/*/usr/lib/python3/dist-packages -name "*.yaml" -exec chmod -x \{\} \;
+	find debian/*/usr/lib/python3/dist-packages \( -name "*.yaml" -o -name "*.Rmd" -o -name "*.snake" -o -name "*.smk" \) -exec chmod -x \{\} \;
 
-### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
-#override_dh_auto_test:
-#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-#	do_stuff_for_testing
-#endif
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	tests/quicktest.sh -s
+endif


=====================================
debian/tests/control → debian/tests/control_deactivated
=====================================



View it on GitLab: https://salsa.debian.org/med-team/covpipe/-/commit/dd8b2601e94b4df4507986665a6b4d9361e44fb5

-- 
View it on GitLab: https://salsa.debian.org/med-team/covpipe/-/commit/dd8b2601e94b4df4507986665a6b4d9361e44fb5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210325/1d53ca61/attachment-0001.htm>


More information about the debian-med-commit mailing list