From edb15d10ce598e4df8c1d2bffed93472d90e5ac8 Mon Sep 17 00:00:00 2001 From: Gilles DAVID Date: Fri, 15 Oct 2021 18:43:08 +0200 Subject: [PATCH] pythonpath_reduction.py: install site-patch.py from setuptools --- bin/pythonpath_reduction.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/pythonpath_reduction.py b/bin/pythonpath_reduction.py index 5ec3e4e6b..8e5e39b05 100644 --- a/bin/pythonpath_reduction.py +++ b/bin/pythonpath_reduction.py @@ -135,6 +135,16 @@ def main(salome_install_dir, context_file_name, env_file_name, ignore=None): logger.debug("Matplotlib isn't compiled with salome or maybe it is in the system package ") logger.debug("If matplotlib is compiled with salome, we need define its install path with variable MATPLOTLIB_HOME") + # Fix for correct imports + import setuptools + try: + setup_tools_path = os.path.dirname(setuptools.__file__) + except AttributeError: + setup_tools_path = os.path.dirname(setuptools.__path__._path[0]) + del setuptools + site_patch = os.path.join(setup_tools_path, 'site-patch.py') + shutil.copyfile(site_patch, os.path.join(pythonpath_common, "site.py")) + # Overwrite salome_context.cfg # Backup context and env files copy(context_file, backup_context_file) -- 2.39.2