From 974269a2ba48d4afcd4a65e3fd55209680ae585d Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Fri, 5 Jul 2024 23:33:57 +0900 Subject: [PATCH] Update setup.py --- setup.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/setup.py b/setup.py index b1f2307..8a5febc 100644 --- a/setup.py +++ b/setup.py @@ -16,12 +16,6 @@ def removeprefix(string, prefix): else: return string -def removesuffix(string, suffix): - if string.endswith(suffix): - return string[:-len(suffix)] - else: - return string - class Clean(Command): user_options = [] def initialize_options(self): @@ -49,7 +43,7 @@ def run(self): home = os.path.expanduser("~") file_and_dirs = glob(home + "/" + ".erg/lib/**", recursive=True) paths = [Path(path) for path in file_and_dirs if os.path.isfile(path)] -files = [(removeprefix(removesuffix(str(path), "/" + path.name), home), str(path)) for path in paths] +files = [(removeprefix(str(path.parent), home), str(path)) for path in paths] data_files = {} for key, value in files: if key in data_files: