Blockstream / greenlight

Build apps using self-custodial lightning nodes in the cloud
https://blockstream.github.io/greenlight/getting-started/
MIT License
109 stars 27 forks source link

Include typehints in `pdoc` #379

Closed ErikDeSmedt closed 3 months ago

ErikDeSmedt commented 6 months ago

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 https://github.com/Blockstream/greenlight/pull/368)
  2. Poorly defined imports in auto-generated GRPC-code (See https://github.com/Blockstream/greenlight/pull/369)
  3. pdoc failing to import type from type-stubs (See https://github.com/mitmproxy/pdoc/pull/671)

All 3 have been addressed and we should be able to do without the work-around. We can merge this once pdoc does a new release.

I've created the PR as a draft to ensure I don't forget about it

cdecker commented 5 months ago

Everything seems to pass alright, do you think this is ready to go in? Undraft it and it will be merged :-)

ErikDeSmedt commented 5 months ago

There is github-action that only triggers on the main-branch. Merging this will break the pipeline and prevent the docs from getting published.

cdecker commented 5 months ago

Gotcha, I'll leave it here until I get your ok 👍

ErikDeSmedt commented 5 months ago

We should probably build the docs before we try to merge a PR. This will allow us to catch issues earlier.

I'll create a separate MR for that.

Randy808 commented 4 months ago

Did you want this to be merged before or after #407? I'm still not sure what this does to be honest

ErikDeSmedt commented 4 months ago

Did you want this to be merged before or after #407? I'm still not sure what this does to be honest

Please merge #407 first. This MR is blocked until pdoc provides a new release.

This MR fixes a couple of warnings when generating the docs.