Pull Request Overview
- Opened on August 19, 2026
- Status Open
- Commit count 16 with first commit July 26, 2026
Total Delta
631 Total Diff Delta
Open Days
Open 33 weekdays
Test Delta
276 Diff Delta in Test Files
Breakdown by Phase
How long has this pull request spent in each phase of its lifecycle?
| Fraction of total time | Business days | Phase |
|---|---|---|
|
|
31.5 days | Authoring 3 commits before pull request opened for review |
|
|
0.1 days | Awaiting first review |
|
|
18.5 days | Revising work with 13 commits in response to 0 reviews that left 6 comments |
Total time for pull request still awaiting merge (longer than repo's target): 50.1 business days
[python-package] [ci] remove runtime docstring building, test with different PYTHONOPTIMIZE levels
Fixes #7362
Contributes to #7327
The Python package has 7 scikit-learn compatible estimators, and there is a lot of overlap in their docstrings. To keep them consistent, the estimators reference build up their docstrings at import time from templates and inherited docstrings, like this:
This proposes removing that stuff in favor of just using literal docstrings.
Changes in this PR
- removes all the import-time docstring-templating stuff, in favor of literal docstrings
- adds unit tests to ensure the docstrings remain consistent with each other
- adds tests in CI that
import lightgbmworks when run underPYTHONOPTIMIZE=1andPYTHONOPTIMIZE=2
Benefits of this change
- allows
lightgbmto be imported when usingPYTHONOPTIMIZE=2(fixes #7362) - very slightly reduces import time (in my local testing, by around 10ms)
- makes it easier to reason about the docs and edit them
How I tested this
- all those unit tests I added
- import-timing code from #7327
- built the docs on readtehdocs
- build: https://app.readthedocs.org/projects/lightgbm/builds/?version__slug=python-no-runtime-doc-parsing
- docs: https://lightgbm.readthedocs.io/en/python-no-runtime-doc-parsing
- build: https://app.readthedocs.org/projects/lightgbm/builds/?version__slug=python-no-runtime-doc-parsing