-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Support PEP-0561 compatible stub-only packages #671
Conversation
I've renamed the |
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.
Thanks for the PR! Could you please add a CHANGELOG entry as well? :)
pdoc/doc_pyi.py
Outdated
module_part_name[0] = f"{module_part_name[0]}-stubs" | ||
module_stub_path = "/".join(module_part_name) | ||
|
||
for path_dir in sys.path: |
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.
for path_dir in sys.path: | |
for search_dir in sys.path: |
maybe? Strong +1 to not overriding builtins, but path
in the variable name is typically a Path
object. I'd be equally happy with just d
.
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.
Fixed
Add support for stub-only package. The typehints for the package `flyingcircus` could be in the `flyingcircus-stubs` package.
b5808ae
to
c17eb4f
Compare
Thanks for the quick review. |
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.
Thanks again! 🍰
We use pdoc to generate a reference of the python `glclient`-library. We suffered some issues related to missing type-hints. The work-around was to remove the type-hints before generating the docs. I've found 3 causes of warnings. 1. Missing export of `SignerHandle` (See Blockstream#368) 2. Poorly defined imports in auto-generated GRPC-code (See Blockstream#369) 3. pdoc failing to import type from type-stubs (See mitmproxy/pdoc#671) All of these 3 issues have been addressed so we don't need the hack anymore.
We use pdoc to generate a reference of the python `glclient`-library. We suffered some issues related to missing type-hints. The work-around was to remove the type-hints before generating the docs. I've found 3 causes of warnings. 1. Missing export of `SignerHandle` (See Blockstream#368) 2. Poorly defined imports in auto-generated GRPC-code (See Blockstream#369) 3. pdoc failing to import type from type-stubs (See mitmproxy/pdoc#671) All of these 3 issues have been addressed so we don't need the hack anymore.
We use pdoc to generate a reference of the python `glclient`-library. We suffered some issues related to missing type-hints. The work-around was to remove the type-hints before generating the docs. I've found 3 causes of warnings. 1. Missing export of `SignerHandle` (See #368) 2. Poorly defined imports in auto-generated GRPC-code (See #369) 3. pdoc failing to import type from type-stubs (See mitmproxy/pdoc#671) All of these 3 issues have been addressed so we don't need the hack anymore.
Add support for stub-only package.
The typehints for the package
flyingcircus
could be in theflyingcircus-stubs
package.