From eb19990bb7a11fe245d460bfef72b8502ecde773 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 06:49:14 +0000 Subject: [PATCH 1/3] Initial plan From 6ba0e7f95e6ff618d40c64deba75c7ada2f68f5f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 06:53:23 +0000 Subject: [PATCH 2/3] Fix Dependabot issue by making ANTLR generation optional - Made antlr4 command check optional in setup.py - Fixed pyproject.toml license format to comply with PEP 621 - Package can now be built without antlr4 for dependency resolution Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- bnf/pyproject.toml | 2 +- bnf/setup.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bnf/pyproject.toml b/bnf/pyproject.toml index ee6ba7f4..c0c214c5 100644 --- a/bnf/pyproject.toml +++ b/bnf/pyproject.toml @@ -15,7 +15,7 @@ requires-python = ">=3.11, <3.15" authors = [{ name = "Hao Zhang", email = "hzhangxyz@outlook.com" }] description = "BNF parser and unparsers for DS - conversion between lisp-like and traditional syntax" readme = "README.md" -license = "AGPL-3.0-or-later" +license = {text = "AGPL-3.0-or-later"} [project.urls] Repository = "https://github.com/USTC-KnowledgeComputingLab/ds.git" diff --git a/bnf/setup.py b/bnf/setup.py index 24d41c49..da1f0a83 100644 --- a/bnf/setup.py +++ b/bnf/setup.py @@ -1,4 +1,5 @@ import subprocess +import shutil from pathlib import Path from setuptools import setup from setuptools.command.build_py import build_py @@ -14,6 +15,12 @@ def generate_antlr_parsers(self): grammars_dir = base_dir output_dir = base_dir / "apyds_bnf" + # Check if antlr4 is available + if not shutil.which("antlr4"): + print("Warning: antlr4 command not found. Skipping parser generation.") + print("This is normal when resolving dependencies (e.g., with Dependabot).") + return + for grammar in ["Ds.g4", "Dsp.g4"]: grammar_path = grammars_dir / grammar From 8679d4477539b8a5fd529745ed6f42183a6fb3c7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 07:03:34 +0000 Subject: [PATCH 3/3] Address PR review feedback - Revert license field format change in pyproject.toml (per review) - Remove comment from setup.py (per review) - Move antlr4 check to top of function (per review) Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- bnf/pyproject.toml | 2 +- bnf/setup.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bnf/pyproject.toml b/bnf/pyproject.toml index c0c214c5..ee6ba7f4 100644 --- a/bnf/pyproject.toml +++ b/bnf/pyproject.toml @@ -15,7 +15,7 @@ requires-python = ">=3.11, <3.15" authors = [{ name = "Hao Zhang", email = "hzhangxyz@outlook.com" }] description = "BNF parser and unparsers for DS - conversion between lisp-like and traditional syntax" readme = "README.md" -license = {text = "AGPL-3.0-or-later"} +license = "AGPL-3.0-or-later" [project.urls] Repository = "https://github.com/USTC-KnowledgeComputingLab/ds.git" diff --git a/bnf/setup.py b/bnf/setup.py index da1f0a83..745595d5 100644 --- a/bnf/setup.py +++ b/bnf/setup.py @@ -11,16 +11,15 @@ def run(self): super().run() def generate_antlr_parsers(self): - base_dir = Path(__file__).parent - grammars_dir = base_dir - output_dir = base_dir / "apyds_bnf" - - # Check if antlr4 is available if not shutil.which("antlr4"): print("Warning: antlr4 command not found. Skipping parser generation.") print("This is normal when resolving dependencies (e.g., with Dependabot).") return + base_dir = Path(__file__).parent + grammars_dir = base_dir + output_dir = base_dir / "apyds_bnf" + for grammar in ["Ds.g4", "Dsp.g4"]: grammar_path = grammars_dir / grammar