-
Notifications
You must be signed in to change notification settings - Fork 19
Fix py.typed in namespace packages #122
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
Previously, the py.typed file was incorrectly put in the namespace package, instead of the non-namespace sub-packages.
Cc @Avasam |
Could someone review this? The google packages are still broken. |
I am back from vacation / AGDQ, I'll try to review as soon as I can, thanks for the bump |
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.
I have one optional suggestion and one request for an additional test concerning py.typed
files. Otherwise LGTM.
distribution: str, expected_packages: list[str] | ||
) -> None: | ||
pkg_data = build_wheel.collect_package_data(THIRD_PARTY_PATH / distribution) | ||
assert pkg_data.top_level_non_namespace_packages == expected_packages |
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.
I just noticed, I think there's no test to validate that py.typed
is added to the right location(s) (top_level_non_namespace_packages
), only that we properly list the locations it should go. Could we add unit tests for the if metadata.partial
branch of generate_setup_file
calling add_partial_markers
?
Edit: Unless you wanna do that as part of #121
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.
Good idea, but I think it makes more sense as part of #121, considering the current command/query mixture.
Co-authored-by: Avasam <samuel.06@hotmail.com>
Unfortunately, it seems that py.typed is now dropped completely from the package. I'll look into it later. |
It's been a few weeks, but I also remember testing this locally where it seemed to work. Probably best to just work on #121 instead of trying to find this bug. |
@srittau Should I wait before merging PRs relating to partial stubs? (ie python/typeshed#11255) Our inclusion or partial py.typed marker is relatively new anyway, so realistically it won't affect many users. |
I would actually be interested if it also affects partial non-namespace packages. |
pyopenssl was released 20h ago and contains the marker file I believe this PR was merged 29h ago? If that's still too close/unsure, you'll know for sure once tensorflow (modified 3h ago) deploys. I think I understand what you're thinking of: maybe only namespace packages are missing the Edit: yep, tensorflow has the marker |
Previously, the py.typed file was incorrectly put in the namespace package, instead of the non-namespace sub-packages.