From 7aad1e6eb1606e58e9da4075523c2ec9d8801fc3 Mon Sep 17 00:00:00 2001 From: Koala Sloth <179892672+koala-sloth@users.noreply.github.com> Date: Thu, 29 Aug 2024 18:41:40 -0700 Subject: [PATCH] Fix glob_paths to correctly include .kv files in package - Modified glob_paths function to properly identify files with given extensions - Now correctly traverses subdirectories and returns relative file paths - Fixes issue where .kv files were missing from pip installations - Also affects .pot and .po files, ensuring all necessary files are included --- kivymd/_version.py | 6 +++--- setup.py | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/kivymd/_version.py b/kivymd/_version.py index 5e2b80cd2..4e9ab1303 100644 --- a/kivymd/_version.py +++ b/kivymd/_version.py @@ -1,5 +1,5 @@ release = False __version__ = "2.0.1.dev0" -__hash__ = "f7bde69707ac708a758a02d89f14997ee468d1ee" -__short_hash__ = "f7bde69" -__date__ = "2024-02-27" +__hash__ = "5ff9d0de78260383fae0737716879781257155a8" +__short_hash__ = "5ff9d0d" +__date__ = "2024-08-30" diff --git a/setup.py b/setup.py index dbf93eeea..a4b930ab4 100755 --- a/setup.py +++ b/setup.py @@ -75,16 +75,17 @@ def glob_paths(pattern): for root, dirs, files in os.walk(src_path): for file in files: if file.endswith(pattern): - filepath = os.path.join(str(Path(*Path(root).parts[1:])), file) + filepath = os.path.join(root, file) + rel_path = os.path.relpath(filepath, src_path) try: - out_files.append(filepath.split(f"kivymd{os.sep}")[1]) - except IndexError: - out_files.append(filepath) + out_files.append(rel_path) + except ValueError: + # This might happen if the file is not within src_path + pass return out_files - if __name__ == "__main__": # Static strings are in setup.cfg update_version_info()