tmrg emits SyntaxWarnings on modern python versions
Summary
During the first bytecode compilation, the tmrg codebase throws around a few SyntaxWarnings. These are harmless in the sense that they don't interrupt program flow and don't reappear on subsequent invocations, but caught me off guard. All of them seem to be related to invalid escaping present in a few places in the code.
Describe your setup
(Summarize the setup you are using; the more information you provide, the easier it will be to reproduce it and fix it) Python 3.12.2, venv with tmake and tmrg, aarch64 linux (Fedora 39)
TMRG Version
Steps to reproduce
- set up a new venv with a newly checked-out version of tmrg
- navigate to
example_simple
in tmake - remove tsmc65 library references
- run
tmake counter-tmr
What is the current bug behavior?
The first time(?) the tmrg code executes, it throws the following bag of warnings at me:
[tmrg ] INFO Running tmrg
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/tmrg.py:63: SyntaxWarning: invalid escape sequence '\.'
identifier1 = Regex(r"\.?["+identLead+"]["+identBody+"]*(\.["+identLead+"]["+identBody+"]*)*"
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/tmrg.py:2202: SyntaxWarning: invalid escape sequence '\['
f.write("""
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/verilog_parser.py:1030: SyntaxWarning: invalid escape sequence '\/'
toks[1]=re.sub("\/\/.*", "", toks[1])
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/prettytable.py:77: SyntaxWarning: invalid escape sequence '\['
_re = re.compile("\033\[[0-9;]*m")
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/prettytable.py:930: SyntaxWarning: invalid escape sequence '\{'
self.vertical_char = random.choice("~!@#$%^&*()_+|-=\{}[];':\",./;<>?")
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/prettytable.py:931: SyntaxWarning: invalid escape sequence '\{'
self.horizontal_char = random.choice("~!@#$%^&*()_+|-=\{}[];':\",./;<>?")
/home/thasti/projekte/dart/tmake_fixes/tmrg/tmrg/prettytable.py:932: SyntaxWarning: invalid escape sequence '\{'
self.junction_char = random.choice("~!@#$%^&*()_+|-=\{}[];':\",./;<>?")
[tmake] INFO Evaluating rule counter-tmr-vrf
What is the expected correct behavior?
(What you should see instead)
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)