Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

The BNF package (apyds-bnf) lacked PEP 561 compliance, preventing type checkers from recognizing its type annotations.

Changes

  • Added py.typed marker file to apyds_bnf/ directory
  • Updated .gitignore to track py.typed

The exported functions already have proper type signatures:

def parse(input: str) -> str: ...
def unparse(input: str) -> str: ...

With the py.typed marker file, external type checkers can now recognize the package's type information according to PEP 561.

Original prompt

This section details on the original issue you should resolve

<issue_title>给bnf下的python包添加py.typed并检查导出的函数确实已经被typed</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 12, 2025 00:50
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add py.typed to bnf python package and verify exports Add py.typed marker and mypy type checking to BNF package Dec 12, 2025
Copilot AI requested a review from hzhangxyz December 12, 2025 00:54
Copy link
Member

@hzhangxyz hzhangxyz left a comment

Choose a reason for hiding this comment

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

不要做多余的事情,加上py typed文件,加到gitignore的例外里就行了,其他不要改

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 12, 2025

不要做多余的事情,加上py typed文件,加到gitignore的例外里就行了,其他不要改

Reverted all extra changes. Only kept the py.typed file and .gitignore exception as requested. (commit f3cf2fe)

Copilot AI changed the title Add py.typed marker and mypy type checking to BNF package Add py.typed marker to BNF package Dec 12, 2025
Copilot AI requested a review from hzhangxyz December 12, 2025 01:14
@hzhangxyz hzhangxyz marked this pull request as ready for review December 12, 2025 01:34
Copilot AI review requested due to automatic review settings December 12, 2025 01:34
@hzhangxyz hzhangxyz merged commit 47c556f into main Dec 12, 2025
7 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds PEP 561 compliance to the BNF package by introducing a py.typed marker file. The package already has properly typed exported functions (parse and unparse), and this change enables external type checkers to recognize the package's type information.

  • Added empty py.typed marker file to signal PEP 561 compliance
  • Updated .gitignore to ensure py.typed is tracked in version control

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
bnf/apyds_bnf/py.typed Empty marker file added to indicate the package supports type checking per PEP 561
bnf/apyds_bnf/.gitignore Updated to explicitly track py.typed alongside __init__.py, while still ignoring ANTLR-generated files

Note: While the changes in this PR are correct, complete PEP 561 compliance requires that py.typed be included in the package distribution configuration (typically via package-data in pyproject.toml). Since pyproject.toml was not modified in this PR, you may want to verify that the file will be included when the package is built and installed. Modern setuptools may or may not automatically include py.typed depending on configuration.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

给bnf下的python包添加py.typed并检查导出的函数确实已经被typed

2 participants