Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bnf/setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import subprocess
import shutil
from pathlib import Path
from setuptools import setup
from setuptools.command.build_py import build_py
import pathlib
import setuptools
import setuptools.command.build_py


class BuildWithAntlr(build_py):
class BuildWithAntlr(setuptools.command.build_py.build_py):

Copilot AI Dec 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class inheritance uses an unnecessarily verbose qualified path. While setuptools.command.build_py.build_py is technically correct, it impacts readability and goes against common Python conventions. Consider using a more concise approach like importing the module as an alias (e.g., from setuptools.command import build_py) or at minimum using the shorter setuptools.command.build_py module with an alias to access the class.

Copilot uses AI. Check for mistakes.
def run(self):
self.generate_antlr_parsers()
super().run()
Expand All @@ -17,7 +17,7 @@ def generate_antlr_parsers(self):
)
return

base_dir = Path(__file__).parent
base_dir = pathlib.Path(__file__).parent
grammars_dir = base_dir
output_dir = base_dir / "apyds_bnf"

Expand All @@ -42,7 +42,7 @@ def generate_antlr_parsers(self):


if __name__ == "__main__":
setup(
setuptools.setup(
cmdclass={
"build_py": BuildWithAntlr,
}
Expand Down