From 2ed9b9de582843ce3681d17ae23b939d169d9892 Mon Sep 17 00:00:00 2001 From: Philipp Grimm Date: Thu, 28 Mar 2024 22:42:39 +0100 Subject: [PATCH] try to fix get site-paclages folder for ubutnu --- tests/test_metadata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 5ed3e5f6..5ffa73ec 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -14,16 +14,16 @@ def get_site_package_folder(self): def find_lib_folder(self, lib_name:str): dirs = [f for f in os.listdir(self.get_site_package_folder()) if f.startswith(lib_name.replace('-', '_')+'-')] if len(dirs) == 1: - for f in os.listdir(os.join(self.get_site_package_folder(),dirs[0])): + for f in os.listdir(os.path.join(self.get_site_package_folder(),dirs[0])): print(f"file in dir: {f}") - return dirs[0] + return os.path.join(self.get_site_package_folder(), dirs[0]) return None def get_installed_lib_version(self, lib_name:str): dir_name = self.find_lib_folder(lib_name) if dir_name: - metadata_file = os.path.join(sys.exec_prefix, 'Lib', 'site-packages', dir_name, 'METADATA') + metadata_file = os.path.join(dir_name, 'METADATA') with open(metadata_file, 'r') as f: for l in f.readlines(): if l.startswith('Version: '):