Commit 055b53b
Fix Dependabot build failure in bnf package by making ANTLR generation optional (#140)
Dependabot was failing to resolve Python dependencies because the build
required the `antlr4` command, which isn't available in Dependabot's
environment.
## Changes
- **`bnf/setup.py`**: Made ANTLR parser generation optional during
build. If `antlr4` command is unavailable, skip generation with a
warning instead of failing. This allows dependency resolution without
requiring the full build toolchain. The check is placed at the top of
the `generate_antlr_parsers()` method for early return.
The package can now be built for metadata extraction (what Dependabot
needs) without ANTLR, while parser generation still works normally when
the tool is available (CI, production builds).
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>bnf下的uv dependabot有点问题</issue_title>
> <issue_description>```
> Dependabot can't resolve your Python dependency files
>
> Dependabot failed to update your dependencies because there was an
error resolving your Python dependency files.
>
> Dependabot encountered the following error:
>
> × Failed to build `apyds-bnf @
> │ file://dependabot_tmp_dir`
> ├─▶ The build backend returned an error
> ╰─▶ Call to `setuptools.build_meta.build_editable` failed (exit
status: 1)
>
> [stdout]
> running egg_info
> creating apyds_bnf.egg-info
> writing apyds_bnf.egg-info/PKG-INFO
> writing dependency_links to apyds_bnf.egg-info/dependency_links.txt
> writing requirements to apyds_bnf.egg-info/requires.txt
> writing top-level names to apyds_bnf.egg-info/top_level.txt
> writing manifest file 'apyds_bnf.egg-info/SOURCES.txt'
>
> [stderr]
> error: package directory 'apyds_bnf' does not exist
>
> hint: This usually indicates a problem with the package or the build
> environment.
>
> [Troubleshoot Dependabot
errors](https://docs.github.com/github/managing-security-vulnerabilities/troubleshooting-dependabot-errors)
> ```</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> <comment_new><author>@hzhangxyz</author><body>
>
https://github.com/USTC-KnowledgeComputingLab/ds/network/updates/1187262040</body></comment_new>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes #139
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/USTC-KnowledgeComputingLab/ds/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>1 parent 52fb2a5 commit 055b53b
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
0 commit comments