[med-svn] [Git][med-team/scoary][master] 5 commits: d/rules: enable build time tests; inspired from .travis.yml.

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Wed Dec 7 21:04:00 GMT 2022



Étienne Mollier pushed to branch master at Debian Med / scoary


Commits:
6348641f by Étienne Mollier at 2022-12-07T22:00:18+01:00
d/rules: enable build time tests; inspired from .travis.yml.

- - - - -
7909993f by Étienne Mollier at 2022-12-07T22:01:11+01:00
python3.11.patch: add; fix failure to open mode 'U' with python3.11.

- - - - -
aa98904a by Étienne Mollier at 2022-12-07T22:01:45+01:00
d/control: update test dependencies, notably remove nose.

Closes: #1018636

- - - - -
99457071 by Étienne Mollier at 2022-12-07T22:02:34+01:00
d/control: add myself to uploaders.

- - - - -
24d87a93 by Étienne Mollier at 2022-12-07T22:03:29+01:00
ready to upload to unstable.

- - - - -


5 changed files:

- debian/changelog
- debian/control
- + debian/patches/python3.11.patch
- + debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+scoary (1.6.16-5) unstable; urgency=medium
+
+  * d/rules: enable build time tests; inspired from .travis.yml.
+  * python3.11.patch: add; fix failure to open mode 'U' with python3.11.
+  * d/control: update test dependencies, notably remove nose.
+    (Closes: #1018636)
+  * d/control: add myself to uploaders.
+
+ -- Étienne Mollier <emollier at debian.org>  Wed, 07 Dec 2022 22:02:55 +0100
+
 scoary (1.6.16-4) unstable; urgency=medium
 
   * Fix watch file


=====================================
debian/control
=====================================
@@ -1,6 +1,7 @@
 Source: scoary
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
+Uploaders: Andreas Tille <tille at debian.org>,
+           Étienne Mollier <emollier at debian.org>
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
@@ -8,7 +9,8 @@ Build-Depends: debhelper-compat (= 13),
                python3-all,
                python3-setuptools,
                python3-scipy,
-               python3-nose <!nocheck>
+               python3-ete3 <!nocheck>,
+               python3-six <!nocheck>
 Standards-Version: 4.6.1
 Vcs-Browser: https://salsa.debian.org/med-team/scoary
 Vcs-Git: https://salsa.debian.org/med-team/scoary.git


=====================================
debian/patches/python3.11.patch
=====================================
@@ -0,0 +1,79 @@
+Description: fix invalid argument in open mode past python3.11.
+ Since python3, the universal newline mode 'U' has no effects.
+ Since python3.11, that mode is obsolete and its use raises:
+
+ Command: scoary.py -g scoary/exampledata/Gene_presence_absence.csv -t scoary/exa
+ mpledata/Tetracycline_resistance.csv -o Test1 --no-time
+ Traceback (most recent call last):
+   File "/<<PKGBUILDDIR>>/scoary.py", line 25, in <module>
+     methods.main()
+   File "/<<PKGBUILDDIR>>/scoary/methods.py", line 184, in main
+     with open(args.genes, "rU") as genes, \
+          ^^^^^^^^^^^^^^^^^^^^^^
+ ValueError: invalid mode: 'rU'
+Author: Étienne Mollier <emollier at debian.org>
+Forwarded: no
+Last-Update: 2022-12-07
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- scoary.orig/scoary/methods.py
++++ scoary/scoary/methods.py
+@@ -181,15 +181,15 @@
+                 cutoffs.pop(m,None)
+             
+         # Start analysis
+-        with open(args.genes, "rU") as genes, \
+-        open(args.traits, "rU") as traits:
++        with open(args.genes, "r") as genes, \
++        open(args.traits, "r") as traits:
+     
+             if args.restrict_to is not None:
+                 # Note: Despite being a dictionary, the values of
+                 # allowed_isolates are not currently used, only the keys
+                 allowed_isolates = {isolate : "all"
+                                     for line in
+-                                    open(args.restrict_to,"rU")
++                                    open(args.restrict_to,"r")
+                                     for isolate in line.rstrip().split(",")}
+             else:
+                 # Despite the confusing name
+@@ -343,7 +343,7 @@
+ 
+     if writereducedset:
+         file = open(ReduceSet(genefile,delimiter, grabcols, startcol,
+-                    allowed_isolates,time,outdir),"rU")
++                    allowed_isolates,time,outdir),"r")
+         csvfile = csv.reader(file, skipinitialspace=True, 
+                              delimiter=delimiter)
+     else:
+--- scoary.orig/scoary/vcf2scoary.py
++++ scoary/scoary/vcf2scoary.py
+@@ -100,7 +100,7 @@
+     if not os.path.isfile(args.vcf):
+         sys.exit("Unable to locate input file %s" % args.vcf)
+ 
+-    with open(args.vcf,'rU') as vcffile, open(args.out,'w') as outfile:
++    with open(args.vcf,'r') as vcffile, open(args.out,'w') as outfile:
+         lines = csv.reader(vcffile, delimiter='\t', quotechar='"')
+         metainfo = {"##INFO" : {},
+                     "##FILTER" : {},
+--- scoary.orig/tests/test_scoary_output.py
++++ scoary/tests/test_scoary_output.py
+@@ -20,7 +20,7 @@
+ 
+ 
+ for Test in ["1","2","4"]:
+-    with open(os.getcwd() + "/Test" + Test + "/Tetracycline_resistance.results.csv" ,"rU") as resfile:
++    with open(os.getcwd() + "/Test" + Test + "/Tetracycline_resistance.results.csv" ,"r") as resfile:
+         tab = csv.reader(resfile, delimiter=",")
+         for i in range(2):
+             if i == 0:
+@@ -120,7 +120,7 @@
+                         print("Not equal at Test %s col 17: %s %s" % (Test, data[17], str(reference[17])))
+                         sys.exit(-1)
+ 
+-with open(os.getcwd() + "/mutations_presence_absence.csv" ,"rU") as vcfresfile:
++with open(os.getcwd() + "/mutations_presence_absence.csv" ,"r") as vcfresfile:
+     tab = csv.reader(vcfresfile, delimiter=",")
+     for i in range(2):
+         if i == 0:


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


=====================================
debian/rules
=====================================
@@ -8,5 +8,34 @@ export LC_ALL = C.UTF-8
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	echo "Test data are missing so we can not test"
+	# tests steps are described in .travis.yml
+	set -e \
+	; for PYTHON3 in $(shell py3versions --supported) \
+	; do \
+		$$PYTHON3 scoary.py \
+			-g scoary/exampledata/Gene_presence_absence.csv \
+			-t scoary/exampledata/Tetracycline_resistance.csv \
+			-o Test1 \
+			--no-time \
+	;	$$PYTHON3 scoary.py \
+			-g scoary/exampledata/Gene_presence_absence.csv \
+			-t scoary/exampledata/Tetracycline_resistance.csv \
+			--no_pairwise \
+			-o Test2 \
+			--no-time \
+	;	$$PYTHON3 scoary.py \
+			-g scoary/exampledata/Gene_presence_absence.csv \
+			-t scoary/exampledata/Tetracycline_resistance.csv \
+			-r scoary/exampledata/Restrict_to.csv \
+			-w -o Test3 --no-time \
+	;	$$PYTHON3 scoary.py \
+			-g scoary/exampledata/Gene_presence_absence.csv \
+			-t scoary/exampledata/Tetracycline_resistance.csv \
+			-p 0.01 1E-5 -c B EPW --collapse -m 50 -u \
+			-n scoary/exampledata/ExampleTree.nwk \
+			--threads 4 -o Test4 --no-time \
+	;	$$PYTHON3 scoary/vcf2scoary.py \
+			--force scoary/exampledata/Example.vcf \
+	;	$$PYTHON3 tests/test_scoary_output.py \
+	; done
 endif



View it on GitLab: https://salsa.debian.org/med-team/scoary/-/compare/10041f27ace4e2f155b8166a184855a760ea3049...24d87a93d2f9d981f16fbc42e2c3bcf0668aa3d1

-- 
View it on GitLab: https://salsa.debian.org/med-team/scoary/-/compare/10041f27ace4e2f155b8166a184855a760ea3049...24d87a93d2f9d981f16fbc42e2c3bcf0668aa3d1
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/20221207/ad12ad3f/attachment-0001.htm>


More information about the debian-med-commit mailing list