[med-svn] [Git][med-team/pbsuite][master] 8 commits: Fix Python3.12 string syntax

Andreas Tille (@tille) gitlab at salsa.debian.org
Mon Dec 9 19:47:20 GMT 2024



Andreas Tille pushed to branch master at Debian Med / pbsuite


Commits:
2f5e4165 by Andreas Tille at 2024-12-09T20:06:54+01:00
Fix Python3.12 string syntax

- - - - -
3766f793 by Andreas Tille at 2024-12-09T20:07:48+01:00
Standards-Version: 4.7.0 (routine-update)

- - - - -
4925a7eb by Andreas Tille at 2024-12-09T20:07:51+01:00
Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)

- - - - -
8cd8884f by Andreas Tille at 2024-12-09T20:07:52+01:00
No tab in license text (routine-update)

- - - - -
3e7666fc by Andreas Tille at 2024-12-09T20:12:47+01:00
Replace use of deprecated $ADTTMP with $AUTOPKGTEST_TMP.

Changes-By: lintian-brush
Fixes: lintian: uses-deprecated-adttmp
See-also: https://lintian.debian.org/tags/uses-deprecated-adttmp.html

- - - - -
d772cbb4 by Andreas Tille at 2024-12-09T20:31:29+01:00
  * autopkgtest:
     - rename script to run-unit-test and install it as user example
     - replace needs-recommends by recommended pbdagcon
     - use default run-unit-test template

- - - - -
7bb942bf by Andreas Tille at 2024-12-09T20:44:15+01:00
Complete Python3.12 synta× patch

- - - - -
1ad5abe4 by Andreas Tille at 2024-12-09T20:46:52+01:00
Upload to unstable

- - - - -


10 changed files:

- + debian/README.test
- debian/changelog
- debian/control
- debian/copyright
- + debian/patches/python3.12-syntax.patch
- debian/patches/series
- debian/pbhoney.docs
- debian/rules
- debian/tests/control
- debian/tests/pbhoney → debian/tests/run-unit-test


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test
+
+in order to confirm its integrity.


=====================================
debian/changelog
=====================================
@@ -1,3 +1,19 @@
+pbsuite (15.8.24+dfsg-8) unstable; urgency=medium
+
+  * Team upload.
+  * Fix Python3.12 string syntax
+    Closes: #1085772
+  * Standards-Version: 4.7.0 (routine-update)
+  * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
+  * No tab in license text (routine-update)
+  * Replace use of deprecated $ADTTMP with $AUTOPKGTEST_TMP.
+  * autopkgtest:
+     - rename script to run-unit-test and install it as user example
+     - replace needs-recommends by recommended pbdagcon
+     - use default run-unit-test template
+
+ -- Andreas Tille <tille at debian.org>  Mon, 09 Dec 2024 20:44:30 +0100
+
 pbsuite (15.8.24+dfsg-7) unstable; urgency=high
 
   * Team Upload.


=====================================
debian/control
=====================================
@@ -4,9 +4,9 @@ Uploaders: Olivier Sallou <osallou at debian.org>
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
-               dh-python,
+               dh-sequence-python3,
                python3-all
-Standards-Version: 4.5.0
+Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/pbsuite
 Vcs-Git: https://salsa.debian.org/med-team/pbsuite.git
 Homepage: http://sourceforge.net/projects/pb-jelly


=====================================
debian/copyright
=====================================
@@ -2,13 +2,13 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: pbsuite
 Source: http://sourceforge.net/p/pb-jelly/code-0/HEAD/tree/
 Files-Excluded:
- 	bin/pbdagcon
- 	bin/sawriter
- 	pbsuite/*.pyc
- 	pbsuite/utils/*.pyc
- 	pbsuite/honey/*.pyc
- 	pbsuite/jelly/*.pyc
- 	pbsuite/banana/*.pyc
+         bin/pbdagcon
+         bin/sawriter
+         pbsuite/*.pyc
+         pbsuite/utils/*.pyc
+         pbsuite/honey/*.pyc
+         pbsuite/jelly/*.pyc
+         pbsuite/banana/*.pyc
 
 Files: *
 Copyright: 2013 Baylor College of Medicine


=====================================
debian/patches/python3.12-syntax.patch
=====================================
@@ -0,0 +1,275 @@
+Description: Fix Python3.12 string syntax
+Bug-Debian: https://bugs.debian.org/1085772
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2024-06-09
+
+--- a/pbsuite/utils/BamStat.py
++++ b/pbsuite/utils/BamStat.py
+@@ -72,7 +72,7 @@ def expandMd(md):
+     Turns abbreviated MD into a full array
+     """
+     ret = []
+-    for i in re.findall("\d+|\^?[ATCGN]+", md):
++    for i in re.findall(r"\d+|\^?[ATCGN]+", md):
+         if i.startswith('^'):
+             ret.extend(list(i[1:]))
+         elif i[0] in ["A","T","C","G","N"]:
+--- a/pbsuite/utils/FileHandlers.py
++++ b/pbsuite/utils/FileHandlers.py
+@@ -46,7 +46,7 @@ class FastaFile(dict):
+             buffer.append( ">" + key + "\n" + wrap(self[key]).strip())
+         return "\n".join(buffer)
+ 
+-splRE = re.compile("\s+")
++splRE = re.compile(r"\s+")
+ class QualFile(dict):
+     
+     def __init__(self, fileName, convert=True):
+@@ -57,7 +57,7 @@ class QualFile(dict):
+         self.fileHandler.close()
+     
+     def __parse(self):
+-        splRE = re.compile("\s+")
++        splRE = re.compile(r"\s+")
+         for line in self.fileHandler.readlines():
+             if line.startswith('>'):
+                 curName = line.strip()[1:]
+@@ -84,7 +84,7 @@ class QualFile(dict):
+             self[curName].write(line.strip() + " ")
+         
+         for key in self:
+-            self[key] = list(map(int, re.split("\s+", self[key].getvalue().strip())))
++            self[key] = list(map(int, re.split(r"\s+", self[key].getvalue().strip())))
+     
+     def toString(self):
+         buffer = []
+@@ -472,7 +472,7 @@ qname tname score pctsimilarity qstrand
+ tstrand tstart tend tseqlength [mapqv ncells npaths]
+ """
+ 
+-subreadGrab = re.compile(".*/(\d+)_(\d+)$")
++subreadGrab = re.compile(r".*/(\d+)_(\d+)$")
+ 
+ class M4File(list):
+ 
+@@ -496,7 +496,7 @@ class M4File(list):
+ class M4Line():
+     
+     def __init__(self, line):
+-        data = re.split("\s+",line)
++        data = re.split(r"\s+",line)
+         
+         self.qname          = data[0]
+         self.tname          = data[1]
+@@ -606,7 +606,7 @@ class M5File(list):
+ class M5Line():
+     
+     def __init__(self, line):
+-        data = re.split("\s+",line)
++        data = re.split(r"\s+",line)
+ 
+         self.qname      = data[0]
+         self.qseqlength = int(data[1])
+--- a/pbsuite/utils/VCFIO.py
++++ b/pbsuite/utils/VCFIO.py
+@@ -107,10 +107,10 @@ class VCFFile():
+         
+ 
+ 
+-METARE = re.compile(('##\s*(?P<key>\w+)\s*=\s*\<\s*ID\s*=\s*(?P<id>\w+)\s*'
+-                     ',\s*(Number\s*=\s*(?P<number>[0-9.])\s*,'
+-                     '\s*Type\s*=\s*(?P<type>\w+)\s*,)?'
+-                     '\s*Description\s*=\s*"(?P<description>.*)"\s*\>\s*'),\
++METARE = re.compile((r'##\s*(?P<key>\w+)\s*=\s*\<\s*ID\s*=\s*(?P<id>\w+)\s*'
++                     r',\s*(Number\s*=\s*(?P<number>[0-9.])\s*,'
++                     r'\s*Type\s*=\s*(?P<type>\w+)\s*,)?'
++                     r'\s*Description\s*=\s*"(?P<description>.*)"\s*\>\s*'),\
+                      re.IGNORECASE)
+ 
+ class META():
+--- a/pbsuite/utils/jellyoutputrename.py
++++ b/pbsuite/utils/jellyoutputrename.py
+@@ -19,7 +19,7 @@ for entry in fasta:
+ 
+ liftOver = json.load(open(sys.argv[2],'r'))
+ jellyFasta = FastaFile(sys.argv[3])
+-regex = re.compile("ref\d{7}")
++regex = re.compile(r"ref\d{7}")
+ for key in liftOver:
+     myRefs = set()
+     for id, strand, size in liftOver[key]:
+--- a/pbsuite/banana/MakeOverlapTable.py
++++ b/pbsuite/banana/MakeOverlapTable.py
+@@ -7,7 +7,7 @@ from collections import deque
+ from pbsuite.utils.setupLogging import *
+ from pbsuite.jelly.Support import AlignmentConnector, SUPPORTFLAGS
+ 
+-subreadGrab = re.compile(".*/(\d+)_(\d+)$")
++subreadGrab = re.compile(r".*/(\d+)_(\d+)$")
+ 
+ def natural_sort(l): 
+     """
+@@ -23,7 +23,7 @@ def natural_sort(l):
+ class M4Line():
+     
+     def __init__(self, line):
+-        data = re.split("\s+",line)
++        data = re.split(r"\s+",line)
+         
+         self.qname          = data[0]
+         self.tname          = data[1]
+--- a/pbsuite/banana/MakeReciprocal.py
++++ b/pbsuite/banana/MakeReciprocal.py
+@@ -9,7 +9,7 @@ USAGE = """%prog <chunk> <stride>
+ Run this in the directory where you've made a whole bunch of alignment chunks.
+ For any Chunk A that has been Mapped to B, we'll make the reciprocal of B mapped to A"""
+ 
+-subreadGrab = re.compile(".*/(\d+)_(\d+)$")
++subreadGrab = re.compile(r".*/(\d+)_(\d+)$")
+ 
+ class M4File(list):
+ 
+@@ -33,7 +33,7 @@ class M4File(list):
+ class M4Line():
+     
+     def __init__(self, line):
+-        data = re.split("\s+",line)
++        data = re.split(r"\s+",line)
+         
+         self.qname          = data[0]
+         self.tname          = data[1]
+--- a/pbsuite/banana/OLCAssembly.py
++++ b/pbsuite/banana/OLCAssembly.py
+@@ -274,7 +274,7 @@ class OLCAssembly:
+             fout.close()
+             
+     def splitIIDs(self, m):
+-        _exe("grep iid alignments.overlaps_realigned | cut -f2 -d\: > internal.ids")
++        _exe(r"grep iid alignments.overlaps_realigned | cut -f2 -d\: > internal.ids")
+         fh = open("internal.ids",'r')
+         n = fh.readlines()
+         fh.close()
+@@ -301,7 +301,7 @@ class OLCAssembly:
+         TODO: Need to know the exception that's thrown when there are no contigOuts
+         """
+         logging.info("Renaming Contigs")
+-        getContigName = re.compile("(\d+)_contig")
++        getContigName = re.compile(r"(\d+)_contig")
+         contigNames = {}
+         bank = amos.AmosBank("out.bank")
+         
+--- a/pbsuite/banana/chunkyBlasr.py
++++ b/pbsuite/banana/chunkyBlasr.py
+@@ -120,7 +120,7 @@ class ChunkyBlasr():
+         for chunk in glob.glob(os.path.join(self.refDir, self.refBase+"*_chunk_*")):
+             logging.info("Filtering out reads < 500bp from %s" % chunk)
+             r, o, e = _exe(("fastalength {0} | "
+-                            "awk -F\  '{{if ($1 < 500) print $2}}' | "
++                            r"awk -F\  '{{if ($1 < 500) print $2}}' | "
+                             "fastaremove {0} stdin > {0}.fasta").format(chunk))
+             logging.debug("RETCODE - %d\nSTDOUT - %s\nSTDERR - %s" %(r,str(o),str(e)))
+             if r != 0:
+--- a/pbsuite/jelly/Setup.py
++++ b/pbsuite/jelly/Setup.py
+@@ -13,7 +13,7 @@ If an <inputScaffolding.qual> exists bes
+ we'll create and incorporate it into PBJelly. Otherwise, it is not necessary
+ """
+ 
+-refParser = re.compile("(.*)\|(ref\d{7})/?(\d+)?$")
++refParser = re.compile(r"(.*)\|(ref\d{7})/?(\d+)?$")
+ 
+ class Setup():
+     def __init__(self):
+--- a/pbsuite/jelly/Stages.py
++++ b/pbsuite/jelly/Stages.py
+@@ -79,7 +79,7 @@ def mapping(jobDirs, outDir, reference,
+             logging.warning("Output File %s already exists and will be overwritten." % (outFile))
+         
+         #Build Blasr Command 
+-        nprocRe = re.compile("--nproc (\d+)")
++        nprocRe = re.compile(r"--nproc (\d+)")
+         np = nprocRe.findall(parameters + extras)
+         if len(np) == 0:
+             np = '1'
+--- a/pbsuite/jelly/m4pie.py
++++ b/pbsuite/jelly/m4pie.py
+@@ -14,7 +14,7 @@ WARNING! -- Input.bam should be produced
+ """
+     
+ def extractTails(aligns, reads, outFq, minLength=100):
+-    """
++    r"""
+     0x1  -- template has multiple segments in sequencing
+     0x40 -- first segment in template
+     0x80 -- last segment in template
+@@ -105,7 +105,7 @@ def uniteTails(origAligns, tailMapFn, ou
+     
+     prolog and eplog will only point to the primary and the primary will point to both
+     """
+-    datGrab = re.compile("^(?P<shift>\d+)(?P<log>[pe])(?P<length>\d+)__(?P<rn>.*)$")
++    datGrab = re.compile(r"^(?P<shift>\d+)(?P<log>[pe])(?P<length>\d+)__(?P<rn>.*)$")
+     
+     aligns = M4File(tailMapFn)
+     mode = 'a' if inplace else 'w'
+--- a/pbsuite/honey/Force.py
++++ b/pbsuite/honey/Force.py
+@@ -520,7 +520,7 @@ def spotsSearch(bam, bed, args):
+     return anyCoverage, ref, vars
+ 
+ #Here are some helper methods for parsing force annotation results
+-forceRe = re.compile("(?P<ref>True|False|\?)\[(?P<tails>.*)\|(?P<spots>.*)\]")
++forceRe = re.compile(r"(?P<ref>True|False|\?)\[(?P<tails>.*)\|(?P<spots>.*)\]")
+ def parseForce(data):
+     """
+     turns the force output into a dict
+--- a/pbsuite/honey/bampie.py
++++ b/pbsuite/honey/bampie.py
+@@ -82,7 +82,7 @@ def callBlasr(inFile, refFile, params, n
+ 
+ 
+ def extractTails(bam, outFq, minLength=100):
+-    """
++    r"""
+     0x1  -- template has multiple segments in sequencing
+     0x40 -- first segment in template
+     0x80 -- last segment in template
+@@ -163,7 +163,7 @@ def uniteTails(mappedFiles, outBam="mult
+     prolog and eplog will only point to the primary and the primary will point to both
+     """
+         
+-    datGrab = re.compile("^(?P<maq>\d+)(?P<log>[pe])(?P<strand>[01])(?P<ref>.*):(?P<pos>\d+)__(?P<rn>.*)$")
++    datGrab = re.compile(r"^(?P<maq>\d+)(?P<log>[pe])(?P<strand>[01])(?P<ref>.*):(?P<pos>\d+)__(?P<rn>.*)$")
+     bout = None
+     for ibam, tbam in mappedFiles:
+         sam = pysam.Samfile(tbam, 'r')
+--- a/pbsuite/jelly/Extraction.py
++++ b/pbsuite/jelly/Extraction.py
+@@ -56,7 +56,7 @@ class Extraction():
+         """
+         Build a TrimInfo namedtuple for this read
+         """
+-        getSub = re.compile("(.*)##(\d+)#(\d+)##$")
++        getSub = re.compile(r"(.*)##(\d+)#(\d+)##$")
+         #Check for trims
+         if readName.endswith('##'):#just endswith? not safe..
+             logging.debug("%s -- Missed Adapter" % readName)
+@@ -323,7 +323,7 @@ class Extraction():
+         selection is a dictionary of { readNames : True } for lookup
+         I'm trying to speed up Extraction as much as possible
+         """
+-        splRE = re.compile("\s+")
++        splRE = re.compile(r"\s+")
+         fasta = FastaFile(fastaFn)
+         qual = QualFile(qualFn, convert=False)
+         logging.info("Selective loading from %d reads" % (len(list(fasta.values()))))
+--- a/pbsuite/honey/realign.py
++++ b/pbsuite/honey/realign.py
+@@ -196,7 +196,7 @@ def expandMd(md):
+     Turns abbreviated MD into a full array
+     """
+     ret = []
+-    for i in re.findall("\d+|\^?[ATCGN]+", md):
++    for i in re.findall(r"\d+|\^?[ATCGN]+", md):
+         if i.startswith('^'):
+             ret.extend(list(i[1:]))
+         elif i[0] in ["A","T","C","G","N"]:


=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@ blasr-5.patch
 intermediate-reads-files.patch
 2to3.patch
 fix_py3.patch
+python3.12-syntax.patch


=====================================
debian/pbhoney.docs
=====================================
@@ -1 +1,3 @@
 docs/HoneyReadme.txt
+debian/tests/run-unit-test
+debian/README.test


=====================================
debian/rules
=====================================
@@ -7,7 +7,7 @@
 exclude = sam2bam sortChunks.sh
 
 %:
-	dh $@ --with python3
+	dh $@
 
 override_dh_auto_build:
 	dh_auto_build


=====================================
debian/tests/control
=====================================
@@ -1,6 +1,4 @@
-Tests: pbhoney
-Depends: pbhoney
-Restrictions:
-	needs-recommends,
-	allow-stderr,
-        skip-not-installable
+Tests: run-unit-test
+Depends: @, pbdagcon
+Restrictions: allow-stderr,
+              skip-not-installable


=====================================
debian/tests/pbhoney → debian/tests/run-unit-test
=====================================
@@ -1,11 +1,19 @@
 #!/bin/sh
 set -e
 
+pkg=pbhoney
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
 # This does not test the accuracy of the code.
 # It's just a check of whether it will actually run successfully
 
-cp -r /usr/share/doc/pbhoney/examples/* $ADTTMP
+cp -r /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP
 
-cd $ADTTMP
+cd $AUTOPKGTEST_TMP
 
 ./workflow.sh



View it on GitLab: https://salsa.debian.org/med-team/pbsuite/-/compare/3122dd6dfd80de1b149be9b80620d6c5fe7b412a...1ad5abe4c2a8b09612bb4d79a2b2dd334fe3d95a

-- 
View it on GitLab: https://salsa.debian.org/med-team/pbsuite/-/compare/3122dd6dfd80de1b149be9b80620d6c5fe7b412a...1ad5abe4c2a8b09612bb4d79a2b2dd334fe3d95a
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/20241209/05a57abb/attachment-0001.htm>


More information about the debian-med-commit mailing list