Add Python API documentation generation with pdoc3

This commit adds automated Python API documentation generation for all
workspace packages using pdoc3:

- Add contrib/api/generate-python-docs.py script to generate docs
- Add Makefile targets: python-docs and python-docs-clean
- Add GitHub Actions workflow for nightly documentation generation
- Documents 5 packages: pyln.client, pyln.proto, pyln.grpc, pyln.testing, pyln.spec.bolt7
- Creates beautiful index page with cards linking to each package
- Stores generated docs as artifacts with 90-day retention
- Add pdoc3 and markdown to dev dependencies

Bug fix:
- Fix pyln-client version.py: __all__ must contain strings, not class objects
  This was causing "TypeError: attribute name must be string, not 'type'" in pdoc3

Documentation is generated to docs/python/ which is excluded from version control.
Run 'make python-docs' to generate locally, or download from nightly workflow artifacts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Christian Decker
2025-11-29 19:21:20 +01:00
parent 4b9cffe183
commit 5c9d3884bb
7 changed files with 294 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ package-mode = false
[dependency-groups]
dev = [
# Test dependencies and inherited dependencies belong here
"crc32c>=2.2.post0", # Belongs to lnprototest
"crc32c>=2.2.post0", # Belongs to lnprototest
"pytest>=8.0.0",
"pytest-xdist>=3.6.0",
"pytest-test-groups>=1.2.0",
@@ -35,6 +35,7 @@ dev = [
"flask-socketio>=5",
"tqdm",
"pytest-benchmark",
"pdoc3>=0.11.6",
]
[project.optional-dependencies]