Skip to content

Commit 30edd80

Browse files
committed
fix(python-driver): regenerate parser with ANTLR 4.13.2 to silence runtime-version-mismatch warning
The generated lexer/parser were hardcoded to check for ANTLR runtime 4.11.1, which triggered a noisy 'ANTLR runtime and generated code versions disagree' warning when installed against a newer runtime like 4.13.2. Regenerating from Agtype.g4 with the 4.13.2 tool aligns the generated checkVersion() call with the default-installed runtime in the allowed dependency range and eliminates the warning. Bumps the declared floor of antlr4-python3-runtime to 4.13.2 so the default install path is warning-free. Made-with: Cursor
1 parent 6eb20ce commit 30edd80

5 files changed

Lines changed: 15 additions & 21 deletions

File tree

drivers/python/age/gen/AgtypeLexer.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
# KIND, either express or implied. See the License for the
1313
# specific language governing permissions and limitations
1414
# under the License.
15-
# Generated from ../Agtype.g4 by ANTLR 4.11.1
16-
15+
# Generated from ../Agtype.g4 by ANTLR 4.13.2
1716
from antlr4 import *
1817
from io import StringIO
1918
import sys
@@ -142,9 +141,7 @@ class AgtypeLexer(Lexer):
142141

143142
def __init__(self, input=None, output:TextIO = sys.stdout):
144143
super().__init__(input, output)
145-
self.checkVersion("4.11.1")
144+
self.checkVersion("4.13.2")
146145
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
147146
self._actions = None
148147
self._predicates = None
149-
150-

drivers/python/age/gen/AgtypeListener.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
# KIND, either express or implied. See the License for the
1313
# specific language governing permissions and limitations
1414
# under the License.
15-
# Generated from ../Agtype.g4 by ANTLR 4.11.1
16-
15+
# Generated from ../Agtype.g4 by ANTLR 4.13.2
1716
from antlr4 import *
18-
if __name__ is not None and "." in __name__:
17+
if "." in __name__:
1918
from .AgtypeParser import AgtypeParser
2019
else:
2120
from AgtypeParser import AgtypeParser
@@ -159,4 +158,4 @@ def exitFloatLiteral(self, ctx:AgtypeParser.FloatLiteralContext):
159158

160159

161160

162-
del AgtypeParser
161+
del AgtypeParser

drivers/python/age/gen/AgtypeParser.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
# KIND, either express or implied. See the License for the
1313
# specific language governing permissions and limitations
1414
# under the License.
15-
# Generated from ../Agtype.g4 by ANTLR 4.11.1
15+
# Generated from ../Agtype.g4 by ANTLR 4.13.2
1616
# encoding: utf-8
17-
1817
from antlr4 import *
1918
from io import StringIO
2019
import sys
@@ -108,7 +107,7 @@ class AgtypeParser ( Parser ):
108107

109108
def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
110109
super().__init__(input, output)
111-
self.checkVersion("4.11.1")
110+
self.checkVersion("4.13.2")
112111
self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
113112
self._predicates = None
114113

@@ -854,5 +853,3 @@ def floatLiteral(self):
854853
finally:
855854
self.exitRule()
856855
return localctx
857-
858-

drivers/python/age/gen/AgtypeVisitor.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
# KIND, either express or implied. See the License for the
1313
# specific language governing permissions and limitations
1414
# under the License.
15-
# Generated from ../Agtype.g4 by ANTLR 4.11.1
16-
15+
# Generated from ../Agtype.g4 by ANTLR 4.13.2
1716
from antlr4 import *
18-
if __name__ is not None and "." in __name__:
17+
if "." in __name__:
1918
from .AgtypeParser import AgtypeParser
2019
else:
2120
from AgtypeParser import AgtypeParser
@@ -100,4 +99,4 @@ def visitFloatLiteral(self, ctx:AgtypeParser.FloatLiteralContext):
10099

101100

102101

103-
del AgtypeParser
102+
del AgtypeParser

drivers/python/pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ classifiers = [
3838
]
3939
dependencies = [
4040
"psycopg",
41-
# ANTLR4 runtime is format-compatible within major versions;
42-
# tested on 4.11.1–4.13.2 with Python 3.9–3.14.
43-
"antlr4-python3-runtime>=4.11.1,<5.0",
41+
# Parser is generated with ANTLR 4.13.2. Runtime is forward- and
42+
# backward-compatible within the 4.x series (checkVersion() emits a
43+
# warning on mismatch but parsing still works); tested on 4.11.1–4.13.2
44+
# with Python 3.9–3.14.
45+
"antlr4-python3-runtime>=4.13.2,<5.0",
4446
]
4547

4648
[project.urls]

0 commit comments

Comments
 (0)