cmu-rss-lab / roswire

A library for static and dynamic analysis of ROS applications via Docker 🔌
http://christimperley.co.uk/roswire
Apache License 2.0
8 stars 0 forks source link

Fix deprecated escape sequences in msg #427

Open ChrisTimperley opened 4 years ago

ChrisTimperley commented 4 years ago
================================================================================= warnings summary =================================================================================
src/roswire/common/msg.py:24
src/roswire/common/msg.py:24
src/roswire/common/msg.py:24
  /home/chris/tools/roswire/src/roswire/common/msg.py:24: DeprecationWarning: invalid escape sequence \s
    R_FIELD = re.compile(f"^\s*({R_TYPE})\s+({R_NAME})\s*{R_COMMENT}$")

src/roswire/common/msg.py:25
  /home/chris/tools/roswire/src/roswire/common/msg.py:25: DeprecationWarning: invalid escape sequence \s
    R_STRING_CONSTANT = re.compile("^\s*string\s+(\w+)\s*=\s*(.+)\s*$")

src/roswire/common/msg.py:26
  /home/chris/tools/roswire/src/roswire/common/msg.py:26: DeprecationWarning: invalid escape sequence \s
    R_OTHER_CONSTANT = re.compile("^\s*(\w+)\s+(\w+)\s*=\s*([^\s]+).*$")

src/roswire/common/msg.py:27
  /home/chris/tools/roswire/src/roswire/common/msg.py:27: DeprecationWarning: invalid escape sequence \s
    R_BLANK = re.compile(f"^\s*{R_COMMENT}$")

src/roswire/common/roslaunch/rosparam.py:48
  /home/chris/tools/roswire/src/roswire/common/roslaunch/rosparam.py:48: DeprecationWarning: invalid escape sequence \(
    '!degrees', re.compile('^deg\([^\)]*\)$'), first='deg(')

src/roswire/common/roslaunch/rosparam.py:51
  /home/chris/tools/roswire/src/roswire/common/roslaunch/rosparam.py:51: DeprecationWarning: invalid escape sequence \(
    '!radians', re.compile('^rad\([^\)]*\)$'), first='rad(')

-- Docs: https://docs.pytest.org/en/stable/warnings.html
tirkarthi commented 4 years ago

Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals. pyupgrade also helps in automatic conversion : https://github.com/asottile/pyupgrade/