From 35e52efcfa6205d566806d356eadb69cd2103e6a Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 15 Nov 2024 11:55:43 +0100 Subject: [PATCH] Change environment to gater Python dependencies --- conanfile.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/conanfile.py b/conanfile.py index c1ff14f01da..e69c5f1e74e 100644 --- a/conanfile.py +++ b/conanfile.py @@ -141,20 +141,22 @@ def _python_installs(self): python_installs = {} # list of python installs - run_env = VirtualRunEnv(self) - env = run_env.environment() + # run_env = VirtualRunEnv(self) + # env = run_env.environment() #env.prepend_path("PYTHONPATH", str(self._site_packages.as_posix())) - venv_vars = env.vars(self, scope = "run") + # venv_vars = env.vars(self, scope = "run") outer = '"' if self.settings.os == "Windows" else "'" inner = "'" if self.settings.os == "Windows" else '"' buffer = StringIO() - with venv_vars.apply(): - self.run(f"""python -c {outer}import importlib.metadata; print({inner};{inner}.join([(package.metadata[{inner}Name{inner}]+{inner},{inner}+ package.metadata[{inner}Version{inner}]) for package in importlib.metadata.distributions()])){outer}""", - env = "conanrun", - stdout = buffer) + # with venv_vars.apply(): + self.run(f"""python -c {outer}import importlib.metadata; print({inner};{inner}.join([(package.metadata[{inner}Name{inner}]+{inner},{inner}+ package.metadata[{inner}Version{inner}]) for package in importlib.metadata.distributions()])){outer}""", + env = "run", + stdout = buffer) print(f"############################################################ {buffer.getvalue()}") + # for name, value in venv_vars.items(): + # print(f"{name}={value}") packages = str(buffer.getvalue()).strip('\r\n').split(";") for package in packages: name, version = package.split(",")