[med-svn] [Git][med-team/spades][master] 2 commits: Passing raw regex patterns in Python

Pierre Gruet (@pgt) gitlab at salsa.debian.org
Mon Dec 16 20:28:51 GMT 2024



Pierre Gruet pushed to branch master at Debian Med / spades


Commits:
4b4994e2 by Pierre Gruet at 2024-12-16T21:27:35+01:00
Passing raw regex patterns in Python

- - - - -
dba0a18a by Pierre Gruet at 2024-12-16T21:28:41+01:00
Adding changelog entry of last upload to unstable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/raw_regex_pattern.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -21,6 +21,13 @@ spades (4.0.0+dfsg1-1) experimental; urgency=medium
 
  -- Pierre Gruet <pgt at debian.org>  Wed, 02 Oct 2024 08:56:41 +0200
 
+spades (3.15.5+dfsg-8) unstable; urgency=medium
+
+  * Team upload
+  * Fixing Python3 SyntaxWarning by using raw regex patterns (Closes: #1087093)
+
+ -- Pierre Gruet <pgt at debian.org>  Sat, 14 Dec 2024 00:09:08 +0100
+
 spades (3.15.5+dfsg-7) unstable; urgency=medium
 
   * Replace distutils which is removed in Python3.12


=====================================
debian/patches/raw_regex_pattern.patch
=====================================
@@ -0,0 +1,86 @@
+Description: passing regex patterns as raw strings to avoid SyntaxWarnings with
+ Python 3
+Author: Pierre Gruet <pgt at debian.org>
+Bug-Debian: https://bugs.debian.org/1087093
+Forwarded: no
+Last-Update: 2024-12-14
+
+--- a/src/projects/mts/scripts/common.py
++++ b/src/projects/mts/scripts/common.py
+@@ -84,7 +84,7 @@
+     return sample + "-" + res
+ 
+ id_re = re.compile("\\d+")
+-split_format = re.compile("^([\w.-]+)_\(\d+_\d+\)$")
++split_format = re.compile(r"^([\w.-]+)_\(\d+_\d+\)$")
+ 
+ def extract_id(name):
+     bin_id = None
+@@ -114,7 +114,7 @@
+ 
+ def contig_length(name):
+     # Length of contig split
+-    split = re.search("\((\d+)_(\d+)\)", name)
++    split = re.search(r"\((\d+)_(\d+)\)", name)
+     if split:
+         return int(split.group(2)) - int(split.group(1))
+     #Default format
+--- a/src/projects/mts/scripts/converters.py
++++ b/src/projects/mts/scripts/converters.py
+@@ -41,7 +41,7 @@
+                 self.header(params[1:])
+             self.format(params[0], params[1:])
+ 
+-extract_num = re.compile("\d+")
++extract_num = re.compile(r"\d+")
+ 
+ class BinningParser:
+     def __init__(self, sep=",", filter=None):
+--- a/src/projects/mts/scripts/filter_nucmer.py
++++ b/src/projects/mts/scripts/filter_nucmer.py
+@@ -32,9 +32,9 @@
+     sys.exit(2)
+ 
+ with open(nucmer_output_fn, "r") as nucmer_output:
+-    contig_data = re.compile("CONTIG: ([\w.-]+) \((\d+)bp\)")
+-    align_data = re.compile("Best alignment score: ([\d.]+)")
+-    split_format = re.compile("^([\w.-]+_)_(\d+_\d+)_$") #Replace brackets back
++    contig_data = re.compile(r"CONTIG: ([\w.-]+) \((\d+)bp\)")
++    align_data = re.compile(r"Best alignment score: ([\d.]+)")
++    split_format = re.compile(r"^([\w.-]+_)_(\d+_\d+)_$") #Replace brackets back
+     while True:
+         line = nucmer_output.readline()
+         if not line or line.startswith("Analyzing coverage"):
+--- a/src/projects/mts/scripts/run_tsne.py
++++ b/src/projects/mts/scripts/run_tsne.py
+@@ -83,7 +83,7 @@
+     return points, names
+ 
+ import re
+-extract_num = re.compile("\d+")
++extract_num = re.compile(r"\d+")
+ 
+ def run_tsne(features_file, colors_file, output_prefix
+              , filter_sample=[]
+--- a/src/projects/mts/test.py
++++ b/src/projects/mts/test.py
+@@ -123,7 +123,7 @@
+     class mut:
+         res = 0
+ 
+-    re_num = re.compile("-?\d+(?:\.\d+)?")
++    re_num = re.compile(r"-?\d+(?:\.\d+)?")
+     def read_cell(str):
+         maybe_num = re_num.search(str)
+         if not maybe_num:
+--- a/src/projects/spades/pipeline/spades_pipeline/support.py
++++ b/src/projects/spades/pipeline/spades_pipeline/support.py
+@@ -485,7 +485,7 @@
+         return text
+ 
+     def natural_keys(text):
+-        return [atoi(c) for c in re.split("(\d+)", text)]
++        return [atoi(c) for c in re.split(r"(\d+)", text)]
+ 
+     latest_dir = None
+     for dir_to_test in sorted(glob.glob(pattern), key=natural_keys, reverse=True):


=====================================
debian/patches/series
=====================================
@@ -26,3 +26,4 @@ use_debian_xxhash.patch
 use_debian_cuckoo.patch
 samtools_missing_source.patch
 deactivate_tests_with_no_data.patch
+raw_regex_pattern.patch



View it on GitLab: https://salsa.debian.org/med-team/spades/-/compare/18a83bef87fb0b17e299e404b4a9e7a295c18f75...dba0a18a8ae6f5b027bebc923ef4c1f97051abdd

-- 
View it on GitLab: https://salsa.debian.org/med-team/spades/-/compare/18a83bef87fb0b17e299e404b4a9e7a295c18f75...dba0a18a8ae6f5b027bebc923ef4c1f97051abdd
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/20241216/bac1e507/attachment-0001.htm>


More information about the debian-med-commit mailing list