[python-package] [ci] remove runtime docstring building, test with different PYTHONOPTIMIZE levels #7403

Open
jameslamb opened 9:51am on August 20, 2026 wants to merge 631 Δ into microsoft/lightgbm main from
python/no-runtime-doc-parsing

Pull request #7403 quality checks

Code files and functions touched by this pull request are analyzed below.

Quality targets

How does this pull request compare to chosen code quality targets? Read more about code quality targets.

Target name Target value This PR
Maximum Diff Delta per PR 500 631
Maximum comment count per PR 10 6
Pull request maximum business days between activity 3 19
Pull request maximum business days open 5 33

Coupled files

Are there any files from this commit that are always committed alongside another file? This often suggests that there exists code coupling to potentially remove. Read more about code coupling

No file coupling detected. 🎉

️ Biggest functions grown or shrunk by pull request

Which functions had their line count change as part of this pull request?

Qualified function name View whole function Lines removed Lines added Final line count
_train 1 0 431
python-package/lightgbm/compat.py::_LGBMModelBase::LGBMModel::fit 23 136 323
LGBMClassifier::fit 0 121 208
python-package/lightgbm/compat.py::_LGBMModelBase::LGBMModel::LGBMRanker::fit 0 134 186
DaskLGBMRanker::__init__ 0 121 170
DaskLGBMRegressor::__init__ 0 117 170
packages/client/src/generation/TSClient/Enum.ts::Enum::DaskLGBMClassifier::__init__ 0 105 170
LGBMRegressor::__init__ 10 115 164
LGBMClassifier::__init__ 2 116 164
python-package/lightgbm/compat.py::_LGBMModelBase::LGBMModel::LGBMRanker::__init__ 0 118 164
DaskLGBMRanker::fit 0 114 162
LGBMRegressor::fit 9 118 156
packages/client/src/generation/TSClient/Enum.ts::Enum::DaskLGBMClassifier::fit 0 36 143
DaskLGBMRegressor::fit 0 98 139
test_check_is_fitted::test_feature_names_in_and_predict_warning 0 9 108
python-package/lightgbm/compat.py::_LGBMModelBase::LGBMModel::predict 0 44 105
test_check_is_fitted::test_feature_names_in_and_predict_warning::test_estimator_fit_docstrings_are_consistent 0 11 100
LGBMClassifier::predict_proba 0 44 81
LGBMClassifier::predict 0 44 70
packages/client/src/generation/TSClient/Enum.ts::Enum::DaskLGBMClassifier::predict_proba 0 44 69
DaskLGBMRanker::predict 0 44 68
DaskLGBMRegressor::predict 0 44 68
packages/client/src/generation/TSClient/Enum.ts::Enum::DaskLGBMClassifier::predict 0 15 68
test_check_is_fitted::test_fit_only_raises_num_rounds_warning_when_expected 0 2 49
python-package/lightgbm/compat.py::_LGBMModelBase::_validate_eval_set_Xy 22 0 33
tests/python_package_test/test_sklearn.py::custom_dummy_obj::test_grid_search 0 2 25
make_synthetic_regression::assert_docstrings_equal 0 8 22
make_synthetic_regression::assert_docstrings_equal 0 14 21
python-package/lightgbm/compat.py::_LGBMModelBase::_extract_evaluation_meta_data 11 0 21
make_synthetic_regression::assert_docstrings_equal 0 1 21
tests/python_package_test/test_sklearn.py::custom_dummy_obj::test_xendcg 0 1 19
tests/python_package_test/test_sklearn.py::custom_dummy_obj::test_classifier_predict_and_predict_proba_docstrings_are_consistent 1 0 17
test_check_is_fitted::_tested_estimators::test_classifier_predict_and_predict_proba_docstrings_are_consistent 0 1 16
tests/python_package_test/test_sklearn.py::custom_dummy_obj::test_eval_at_aliases 0 8 10
python-package/lightgbm/compat.py::_LGBMModelBase::LGBMModel::n_estimators_ 2 0 10
test_check_is_fitted::test_feature_names_in_and_predict_warning::test_estimator_docstrings_that_should_be_identical 0 5 3
make_synthetic_regression::assert_datasets_equal 0 2 3
tests/python_package_test/test_sklearn.py::custom_dummy_obj::test_estimator_docstrings_that_should_be_identical 0 1 3