use import function
import contextlib
import distutils.util
+import importlib
import os
import re
import shutil
@@ -7,7 +8,20 @@ import subprocess
import sys
import tempfile
-from . import utils
+
+# This is done because pip is installed in no editable mode in
+# windows CI so the kernel cache gets always a deterministic path.
+def _from_install_import(name):
+ install_module_path = os.path.join(os.path.dirname(__file__))
+ original_sys_path = sys.path.copy()
+ try:
+ sys.path.append(install_module_path)
+ return importlib.import_module(name)
+ finally:
+ sys.path = original_sys_path
+
+
+utils = _from_install_import('utils')
PLATFORM_LINUX = sys.platform.startswith('linux')
