Description: use raw strings to avoid syntax warnings
Author: Ananthu C V <weepingclown@debian.org>
Last-Update: 2024-12-05
--- a/ruffus/cmdline.py
+++ b/ruffus/cmdline.py
@@ -667,3 +667,3 @@
 def handle_verbose(options):
-    """
+    r"""
     raw options.verbose is a list of specifiers
@@ -706,4 +706,4 @@
     #       '+'         : i.e. --verbose. This just increases the current verbosity value by 1
-    #       '\d+'       : e.g. --verbose 6. This (re)sets the verbosity value
-    #       '\d+:\d+'   : e.g. --verbose 7:-5 The second number is the verbose_abbreviated_path
+    #       r'\d+'       : e.g. --verbose 6. This (re)sets the verbosity value
+    #       r'\d+:\d+'   : e.g. --verbose 7:-5 The second number is the verbose_abbreviated_path
     #
--- a/ruffus/combinatorics.py
+++ b/ruffus/combinatorics.py
@@ -25,3 +25,3 @@
 #################################################################################
-"""
+r"""
 
--- a/ruffus/proxy_logger.py
+++ b/ruffus/proxy_logger.py
@@ -25,3 +25,3 @@
 #################################################################################
-"""
+r"""
 ****************************************************************************
@@ -322,3 +322,3 @@
 def make_shared_logger_and_proxy(logger_factory, logger_name, args):
-    """
+    r"""
     Make a `logging <http://docs.python.org/library/logging.html>`_ object
--- a/ruffus/ruffus_utility.py
+++ b/ruffus/ruffus_utility.py
@@ -501,3 +501,3 @@
 def path_decomposition_regex_match(test_str, compiled_regex):
-    """
+    r"""
     Returns a dictionary identifying the components of a file path.
--- a/ruffus/test/test_combinatorics.py
+++ b/ruffus/test/test_combinatorics.py
@@ -387,6 +387,6 @@
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/e_name.tmp1, '
                                   '.*{tempdir}/h_name.tmp1, '
-                                  '.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -462,5 +462,5 @@
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -488,6 +488,6 @@
         self.assertTrue(re.search(
-            '\[.*{tempdir}/a_name.tmp1, '
+            r'\[.*{tempdir}/a_name.tmp1, '
             '.*{tempdir}/b_name.tmp1, '
             '.*{tempdir}/c_name.tmp1, '
-            '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+            r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -515,5 +515,5 @@
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -540,6 +540,6 @@
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -567,5 +567,5 @@
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -592,6 +592,6 @@
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
--- a/ruffus/test/test_newstyle_regex_error_messages.py
+++ b/ruffus/test/test_newstyle_regex_error_messages.py
@@ -309,3 +309,3 @@
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -351,3 +351,3 @@
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -369,3 +369,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_printout,
@@ -374,3 +374,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                test_pipeline.run,
@@ -408,3 +408,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.printout,
@@ -413,3 +413,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.run,
@@ -425,3 +425,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.printout,
@@ -430,3 +430,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.run,
@@ -443,3 +443,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                test_pipeline.printout,
@@ -448,3 +448,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                test_pipeline.run,
--- a/ruffus/test/test_file_name_parameters.py
+++ b/ruffus/test/test_file_name_parameters.py
@@ -799,3 +799,3 @@
         unnamed_args = [tempdir + "/*.test",
-                        task.formatter("/(?P<name>\w+).test$"),
+                        task.formatter(r"/(?P<name>\w+).test$"),
                         ["{path[0]}/{name[0]}.output1{ext[0]}", "{path[0]}/{name[0]}.output2"], "{path[0]}/{name[0]}.output3"]
@@ -1591,5 +1591,5 @@
         args = [[tempdir + "/a.test1", tempdir + "/b.test1"],
-                task.formatter("(?:.+/)?(?P<ID>\w+)\.(.+)"),
+                task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(.+)"),
                 [tempdir + "/c.test2", tempdir + "/d.test2", tempdir + "/e.ignore"],
-                task.formatter("(?:.+/)?(?P<ID>\w+)\.(test2)"),
+                task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(test2)"),
                 r"{path[0][0]}/{ID[0][0]}.{1[1][0]}.output"]
@@ -1632,5 +1632,5 @@
         #
-        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter("(?:.+/)?(?P<ID>\w+)\.(.+)"),
+        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(.+)"),
                                      [tempdir + "/c.test2", tempdir + "/d.test2", tempdir +
-                                         "/e.ignore"], task.formatter("(?:.+/)?(?P<ID>\w+)\.(test2)"),
+                                         "/e.ignore"], task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(test2)"),
                                      task.inputs(
@@ -1651,5 +1651,5 @@
         #
-        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter("(?:.+/)?(?P<ID>\w+)\.(.+)"),
+        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(.+)"),
                                      [tempdir + "/c.test2", tempdir + "/d.test2", tempdir +
-                                         "/e.ignore"], task.formatter("(?:.+/)?(?P<ID>\w+)\.(test2)"),
+                                         "/e.ignore"], task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(test2)"),
                                      add_inputs(
--- a/ruffus/test/test_ruffus_utility.py
+++ b/ruffus/test/test_ruffus_utility.py
@@ -510,3 +510,3 @@
     def helper(self, data, result):
-        regex_str = "([a-z]+)\.([a-z]+)\.([a-z]+)\.([a-z]+)"
+        regex_str = r"([a-z]+)\.([a-z]+)\.([a-z]+)\.([a-z]+)"
         try_result = regex_replace("aaa.bbb.ccc.aaa",
--- a/ruffus/test/test_newstyle_combinatorics.py
+++ b/ruffus/test/test_newstyle_combinatorics.py
@@ -399,6 +399,6 @@
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/e_name.tmp1, '
                                   '.*{tempdir}/h_name.tmp1, '
-                                  '.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -473,5 +473,5 @@
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -499,6 +499,6 @@
         self.assertTrue(re.search(
-            '\[.*{tempdir}/a_name.tmp1, '
+            r'\[.*{tempdir}/a_name.tmp1, '
             '.*{tempdir}/b_name.tmp1, '
             '.*{tempdir}/c_name.tmp1, '
-            '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+            r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -526,5 +526,5 @@
             s, [check_permutations2_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -551,6 +551,6 @@
             s, [check_permutations3_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -578,5 +578,5 @@
             s, [check_combinations_with_replacement2_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
@@ -603,6 +603,6 @@
             s, [check_combinations_with_replacement3_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
--- a/ruffus/test/test_regex_error_messages.py
+++ b/ruffus/test/test_regex_error_messages.py
@@ -301,3 +301,3 @@
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -343,3 +343,3 @@
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
@@ -361,3 +361,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_printout,
@@ -366,3 +366,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_run,
@@ -400,3 +400,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_printout,
@@ -405,3 +405,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_run,
@@ -417,3 +417,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_printout,
@@ -422,3 +422,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_run,
@@ -435,3 +435,3 @@
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_printout,
@@ -440,3 +440,3 @@
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_run,
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -67,3 +67,3 @@
 import re
-release = re.subn("([\d\.]+).*", r"\1", version)[0]
+release = re.subn(r"([\d\.]+).*", r"\1", version)[0]
 print(version, release)
--- a/ruffus/parse_old_style_ruffus.py
+++ b/ruffus/parse_old_style_ruffus.py
@@ -177,3 +177,3 @@
 
-func_re = re.compile("^\s*def.*\(")
+func_re = re.compile(r"^\s*def.*\(")
 
@@ -194,4 +194,4 @@
 
-decorator_re = re.compile("^\s*@")
-no_white_space_re = re.compile("^[^#\s]")
+decorator_re = re.compile(r"^\s*@")
+no_white_space_re = re.compile(r"^[^#\s]")
 if __name__ == '__main__':
