Repository: horovod/horovod

Issue:
Deprecation warning due to invalid escape sequences in Python 3.7
**Environment:**
1. Framework: (TensorFlow, Keras, PyTorch, MXNet)
2. Framework version:
3. Horovod version:
4. MPI version:
5. CUDA version:
6. NCCL version:
7. Python version: 3.7
8. OS and version: Linux Ubuntu 18.04
9. GCC version:

**Bug report:**

Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals.

```
find . -iname '*.py' | grep -Ev 'example|utl|samples' | xargs -P 4 -I{} python3.8 -Wall -m py_compile {} 
./setup.py:1008: DeprecationWarning: invalid escape sequence \d
  m = re.match('^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?', version_str)
./test/test_run.py:332: DeprecationWarning: invalid escape sequence \.
  exception = 'Neither MPI nor Gloo support has been built\. Try reinstalling Horovod ensuring that ' \
./test/test_run.py:333: DeprecationWarning: invalid escape sequence \(
  'either MPI is installed \(MPI\) or CMake is installed \(Gloo\)\.'
./test/test_run.py:322: DeprecationWarning: invalid escape sequence \.
  exception = '^MPI support has not been built\.  If this is not expected, ensure MPI is installed ' \
./test/test_run.py:323: DeprecationWarning: invalid escape sequence \.
  'and reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error\.$'
./test/test_run.py:312: DeprecationWarning: invalid escape sequence \.
  exception = '^MPI support has not been built\.  If this is not expected, ensure MPI is installed ' \
./test/test_run.py:313: DeprecationWarning: invalid escape sequence \.
  'and reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error\.$'
./test/test_run.py:306: DeprecationWarning: invalid escape sequence \.
  exception = '^Gloo support has not been built\.  If this is not expected, ensure CMake is installed ' \
./test/test_run.py:307: DeprecationWarning: invalid escape sequence \.
  'and reinstall Horovod with HOROVOD_WITH_GLOO=1 to debug the build error\.$'
```



Discussion:
Thanks for raising this issue, @tirkarthi.  Are you interested in creating a PR for this?

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1005,7 +1005,7 @@ def build_tf_extension(build_ext, global_options):
 def parse_version(version_str):
     if "dev" in version_str:
         return 9999999999
-    m = re.match('^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?', version_str)
+    m = re.match(r'^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?', version_str)
     if m is None:
         return None
 


Test patch:
diff --git a/test/test_run.py b/test/test_run.py
--- a/test/test_run.py
+++ b/test/test_run.py
@@ -303,14 +303,14 @@ def test(use_gloo, use_mpi, use_js,
                 if gloo_is_built:
                     expected = 'gloo'
                 else:
-                    exception = '^Gloo support has not been built\.  If this is not expected, ensure CMake is installed ' \
-                                'and reinstall Horovod with HOROVOD_WITH_GLOO=1 to debug the build error\.$'
+                    exception = r'^Gloo support has not been built\.  If this is not expected, ensure CMake is installed ' \
+                                r'and reinstall Horovod with HOROVOD_WITH_GLOO=1 to debug the build error\.$'
             elif use_mpi:
                 if mpi_is_built:
                     expected = 'mpi'
                 else:
-                    exception = '^MPI support has not been built\.  If this is not expected, ensure MPI is installed ' \
-                                'and reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error\.$'
+                    exception = r'^MPI support has not been built\.  If this is not expected, ensure MPI is installed ' \
+                                r'and reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error\.$'
             elif use_js:
                 if mpi_is_built:
                     if lsf_exists:
@@ -319,8 +319,8 @@ def test(use_gloo, use_mpi, use_js,
                         exception = 'Horovod did not detect an LSF job.  The jsrun launcher can only be used in that environment. ' \
                                     'Please, pick a different launcher for other environments.'
                 else:
-                    exception = '^MPI support has not been built\.  If this is not expected, ensure MPI is installed ' \
-                                'and reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error\.$'
+                    exception = r'^MPI support has not been built\.  If this is not expected, ensure MPI is installed ' \
+                                r'and reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error\.$'
             elif mpi_is_built:
                 if lsf_exists and jsrun_installed:
                     expected = 'js'
@@ -329,8 +329,8 @@ def test(use_gloo, use_mpi, use_js,
             elif gloo_is_built:
                 expected = 'gloo'
             else:
-                exception = 'Neither MPI nor Gloo support has been built\. Try reinstalling Horovod ensuring that ' \
-                            'either MPI is installed \(MPI\) or CMake is installed \(Gloo\)\.'
+                exception = r'Neither MPI nor Gloo support has been built\. Try reinstalling Horovod ensuring that ' \
+                            r'either MPI is installed \(MPI\) or CMake is installed \(Gloo\)\.'
 
             test(use_gloo, use_mpi, use_js,
                  gloo_is_built, mpi_is_built,