|
70 | 70 | # We are not importing the rest of scikit-learn during the build
|
71 | 71 | # process, as it may not be compiled yet
|
72 | 72 | else:
|
73 |
| - from . import __check_build |
| 73 | + # `_distributor_init` allows distributors to run custom init code. |
| 74 | + # For instance, for the Windows wheel, this is used to pre-load the |
| 75 | + # vcomp shared library runtime for OpenMP embedded in the sklearn/.libs |
| 76 | + # sub-folder. |
| 77 | + # It is necessary to do this prior to importing show_versions as the |
| 78 | + # later is linked to the OpenMP runtime to make it possible to introspect |
| 79 | + # it and importing it first would fail if the OpenMP dll cannot be found. |
| 80 | + from . import _distributor_init # noqa: F401 |
| 81 | + from . import __check_build # noqa: F401 |
74 | 82 | from .base import clone
|
75 | 83 | from .utils._show_versions import show_versions
|
76 | 84 |
|
77 |
| - __check_build # avoid flakes unused variable error |
78 |
| - |
79 | 85 | __all__ = ['calibration', 'cluster', 'covariance', 'cross_decomposition',
|
80 | 86 | 'datasets', 'decomposition', 'dummy', 'ensemble', 'exceptions',
|
81 | 87 | 'experimental', 'externals', 'feature_extraction',
|
|
90 | 96 | 'clone', 'get_config', 'set_config', 'config_context',
|
91 | 97 | 'show_versions']
|
92 | 98 |
|
93 |
| - # Allow distributors to run custom init code |
94 |
| - from . import _distributor_init # noqa: F401 |
95 |
| - |
96 | 99 |
|
97 | 100 | def setup_module(module):
|
98 | 101 | """Fixture for the tests to assure globally controllable seeding of RNGs"""
|
|
0 commit comments