[med-svn] [Git][med-team/iva][master] 4 commits: syntax-warning.patch: apply raw strings to regexes.

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Wed Dec 4 20:42:46 GMT 2024



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


Commits:
d2abf919 by Étienne Mollier at 2024-12-04T20:59:32+01:00
syntax-warning.patch: apply raw strings to regexes.

Closes: #1085655

- - - - -
051991d9 by Étienne Mollier at 2024-12-04T21:02:52+01:00
python3.12.patch: normalize last update timestamp.

- - - - -
0d90c197 by Étienne Mollier at 2024-12-04T21:09:36+01:00
d/patches/*: indicate the forwarding status.

- - - - -
291442b0 by Étienne Mollier at 2024-12-04T21:42:17+01:00
d/changelog: ready for upload to unstable.

- - - - -


8 changed files:

- debian/changelog
- debian/patches/disable-multithreaded-test.patch
- debian/patches/disable-ram-test.patch
- debian/patches/perl-shebang.patch
- debian/patches/python3.12.patch
- debian/patches/samtools1.10
- debian/patches/series
- + debian/patches/syntax-warning.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+iva (1.0.11+ds-6) unstable; urgency=medium
+
+  * Team upload.
+  * syntax-warning.patch: apply raw strings to regexes. (Closes: #1085655)
+  * python3.12.patch: normalize last update timestamp.
+  * d/patches/*: indicate the forwarding status.
+
+ -- Étienne Mollier <emollier at debian.org>  Wed, 04 Dec 2024 21:42:08 +0100
+
 iva (1.0.11+ds-5) unstable; urgency=medium
 
   * Python3.12 compatibility by avoiding usage of distutils


=====================================
debian/patches/disable-multithreaded-test.patch
=====================================
@@ -5,6 +5,8 @@ Description: disable multithreaded test
  This patch disables this test to allow building at the minor expense of this
  missing test.
 Author: Sascha Steinbiss <satta at debian.org>
+Forwarded: not-needed
+
 --- a/iva/tests/seed_processor_test.py
 +++ b/iva/tests/seed_processor_test.py
 @@ -22,7 +22,7 @@


=====================================
debian/patches/disable-ram-test.patch
=====================================
@@ -5,6 +5,8 @@ Description: disable tests that run KMC
  Let's disable these tests for now.
 Author: Sascha Steinbiss <satta at debian.org>
 Last-Update: 2020-02-09
+Forwarded: not-needed
+
 --- a/iva/tests/assembly_test.py
 +++ b/iva/tests/assembly_test.py
 @@ -158,7 +158,7 @@


=====================================
debian/patches/perl-shebang.patch
=====================================
@@ -1,5 +1,7 @@
 Description: Use Debian's Perl path
 Author: Sascha Steinbiss <satta at debian.org>
+Forwarded: not-needed
+
 --- a/iva/ratt/embl2gff.pl
 +++ b/iva/ratt/embl2gff.pl
 @@ -1,4 +1,4 @@


=====================================
debian/patches/python3.12.patch
=====================================
@@ -1,7 +1,8 @@
 Description: Python3.12 compatibility by avoiding usage of distutils
 Bug-Debian: https://bugs.debian.org/1061804
 Author: Andreas Tille <tille at debian.org>
-Last-Update: Thu, 01 Feb 2024 13:32:00 +0100
+Last-Update: 2024-02-01
+Forwarded: https://github.com/sanger-pathogens/iva/pull/110
 
 --- a/iva/external_progs.py
 +++ b/iva/external_progs.py


=====================================
debian/patches/samtools1.10
=====================================
@@ -1,5 +1,7 @@
 From: Michael R. Crusoe <michael.crusoe at gmail.com>
 Subject: Fix samtools version parsing so that 1.10 > 1.2
+Forwarded: https://github.com/sanger-pathogens/iva/pull/110
+
 --- a/iva/mapping.py
 +++ b/iva/mapping.py
 @@ -23,6 +23,8 @@ from iva import external_progs


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@ perl-shebang.patch
 samtools1.10
 disable-ram-test.patch
 python3.12.patch
+syntax-warning.patch


=====================================
debian/patches/syntax-warning.patch
=====================================
@@ -0,0 +1,106 @@
+Description: raw strings for regexes.
+ Starting with at least Python 3.13, bytecode compilation of iva
+ scripts results in multiple syntax warnings:
+ .
+         Setting up iva (1.0.11+ds-5) ...
+         /usr/lib/python3/dist-packages/iva/external_progs.py:33: SyntaxWarning: invalid escape sequence '\('
+           'kmc': ('kmc', re.compile('^K-Mer Counter \(KMC\) ver\. (.*) \(.*\)$')),
+         /usr/lib/python3/dist-packages/iva/external_progs.py:34: SyntaxWarning: invalid escape sequence '\('
+           'kmc_dump': ('kmc_dump', re.compile('^KMC dump ver. (.*) \(.*\)$')),
+         /usr/lib/python3/dist-packages/iva/external_progs.py:37: SyntaxWarning: invalid escape sequence '\('
+           'nucmer': ('nucmer --version', re.compile('^NUCmer \(NUCleotide MUMmer\) version (.*)$')),
+         /usr/lib/python3/dist-packages/iva/external_progs.py:38: SyntaxWarning: invalid escape sequence '\('
+           'R': ('R --version', re.compile('^R version (.*) \(.*\) --')),
+         /usr/lib/python3/dist-packages/iva/external_progs.py:40: SyntaxWarning: invalid escape sequence '\d'
+           'samtools': ('samtools', re.compile('(\d+\.\d+[\.\d]*)')),
+         /usr/lib/python3/dist-packages/iva/kraken.py:360: SyntaxWarning: invalid escape sequence '\.'
+           self._genbank2embl(fname, re.sub('\.gbk$', '', fname) + '.embl')
+         /usr/lib/python3/dist-packages/iva/kraken.py:415: SyntaxWarning: invalid escape sequence '\W'
+           return re.sub('\W', '_', s).strip('_')
+         /usr/lib/python3/dist-packages/iva/mapping.py:161: SyntaxWarning: invalid escape sequence '\^'
+           s = re.sub('\^.', '', s)
+ .
+ This change goes through regexes occurrences to make them raw strings,
+ in order to make them more robust to backslash usage.
+
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085655
+Forwarded: https://github.com/sanger-pathogens/iva/pull/110
+Last-Update: 2024-12-04
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- iva.orig/iva/external_progs.py
++++ iva/iva/external_progs.py
+@@ -28,16 +28,16 @@
+ 
+ 
+ prog_to_version_cmd = {
+-    'blastn': ('blastn -version', re.compile('^blastn: (.*)$')),
+-    'makeblastdb': ('makeblastdb -version', re.compile('makeblastdb: (.*)$')),
+-    'kmc': ('kmc', re.compile('^K-Mer Counter \(KMC\) ver\. (.*) \(.*\)$')),
+-    'kmc_dump': ('kmc_dump', re.compile('^KMC dump ver. (.*) \(.*\)$')),
+-    'kraken': ('kraken --version', re.compile('^Kraken version (.*)$')),
+-    'kraken-build': ('kraken-build --version', re.compile('^Kraken version (.*)$')),
+-    'nucmer': ('nucmer --version', re.compile('^NUCmer \(NUCleotide MUMmer\) version (.*)$')),
+-    'R': ('R --version', re.compile('^R version (.*) \(.*\) --')),
+-    'smalt': ('smalt version', re.compile('^Version: (.*)$')),
+-    'samtools': ('samtools', re.compile('(\d+\.\d+[\.\d]*)')),
++    'blastn': ('blastn -version', re.compile(r'^blastn: (.*)$')),
++    'makeblastdb': ('makeblastdb -version', re.compile(r'makeblastdb: (.*)$')),
++    'kmc': ('kmc', re.compile(r'^K-Mer Counter \(KMC\) ver\. (.*) \(.*\)$')),
++    'kmc_dump': ('kmc_dump', re.compile(r'^KMC dump ver. (.*) \(.*\)$')),
++    'kraken': ('kraken --version', re.compile(r'^Kraken version (.*)$')),
++    'kraken-build': ('kraken-build --version', re.compile(r'^Kraken version (.*)$')),
++    'nucmer': ('nucmer --version', re.compile(r'^NUCmer \(NUCleotide MUMmer\) version (.*)$')),
++    'R': ('R --version', re.compile(r'^R version (.*) \(.*\) --')),
++    'smalt': ('smalt version', re.compile(r'^Version: (.*)$')),
++    'samtools': ('samtools', re.compile(r'(\d+\.\d+[\.\d]*)')),
+ }
+ 
+ 
+--- iva.orig/iva/kraken.py
++++ iva/iva/kraken.py
+@@ -357,7 +357,7 @@
+             if self.verbose:
+                 print('Converting', directory, end=' ', flush=True)
+             for fname in gbk_files:
+-                self._genbank2embl(fname, re.sub('\.gbk$', '', fname) + '.embl')
++                self._genbank2embl(fname, re.sub(r'\.gbk$', '', fname) + '.embl')
+                 os.unlink(fname)
+                 if self.verbose:
+                     print(fname, end=' ', flush=True)
+@@ -365,7 +365,7 @@
+             os.chdir(original_dir)
+             if self.verbose:
+                 print()
+-            new_dir = re.sub('_uid[0-9]+$', '', directory).strip('_')
++            new_dir = re.sub(r'_uid[0-9]+$', '', directory).strip('_')
+             if new_dir != directory:
+                 os.rename(directory, new_dir)
+ 
+@@ -412,7 +412,7 @@
+         if s.startswith('added.'):
+             return s
+         else:
+-            return re.sub('\W', '_', s).strip('_')
++            return re.sub(r'\W', '_', s).strip('_')
+ 
+ 
+     def _get_most_common_species_dir(self, kraken_report):
+--- iva.orig/iva/mapping.py
++++ iva/iva/mapping.py
+@@ -158,12 +158,12 @@
+ 
+ 
+ def strip_mpileup_coverage_string(s):
+-    s = re.sub('\^.', '', s)
++    s = re.sub(r'\^.', '', s)
+     a = list(s)
+     a = _remove_indels(a, '+')
+     a = _remove_indels(a, '-')
+     s = ''.join(a)
+-    return re.sub('[*$]', '', s)
++    return re.sub(r'[*$]', '', s)
+ 
+ 
+ def consensus_base(counts, keys, ratio=0.5):



View it on GitLab: https://salsa.debian.org/med-team/iva/-/compare/9a12b109d031b5406f552d3fe89dfff45ceafdc1...291442b0aabee79871be0e446f17d3ef68b4d91b

-- 
View it on GitLab: https://salsa.debian.org/med-team/iva/-/compare/9a12b109d031b5406f552d3fe89dfff45ceafdc1...291442b0aabee79871be0e446f17d3ef68b4d91b
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/20241204/49555cd8/attachment-0001.htm>


More information about the debian-med-commit mailing list