-
Notifications
You must be signed in to change notification settings - Fork 0
Add py.typed marker to BNF package #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
hzhangxyz
left a comment
There was a problem hiding this 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>
Reverted all extra changes. Only kept the py.typed file and .gitignore exception as requested. (commit f3cf2fe) |
There was a problem hiding this 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.typedmarker file to signal PEP 561 compliance - Updated
.gitignoreto ensurepy.typedis 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.
The BNF package (
apyds-bnf) lacked PEP 561 compliance, preventing type checkers from recognizing its type annotations.Changes
py.typedmarker file toapyds_bnf/directory.gitignoreto trackpy.typedThe exported functions already have proper type signatures:
With the
py.typedmarker file, external type checkers can now recognize the package's type information according to PEP 561.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.