[ci] isolate c_api_test library-loading from Python source tree #5761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributes to #5061
This repo contains a few tests on LightGBM's C API which are run with
pytest
.Today, they load
lib_lightgbm.{dll/so}
using a modified copy of the same library-loading code withctypes
used in the Python package. LightGBM's CI runspython setup.py bdist_wheel
, then these C API tests rely on alib_lightgbm.{dll/so}
being available inpython-package/compile/
.LightGBM/tests/c_api_test/test_.py
Lines 17 to 29 in 709ea4c
This PR proposes removing that reliance on the repo structure + exactly where
lib_lightgbm.so
copies get left behind after building Python wheels.How does this contribute to #5061? The changes for that (in-progress in #5759) will involve building
lightgbm
wheels in an isolated build directory, which breaks the assumptions inc_api_test/test_.py
that alib_lightgbm
will be left behind in thepython-package/
directory.How I tested this
Check that this works with the Python package installed.
Check that it works without the Python package.