From 9309ab88621b3fc824b4b82682d446716cfb2196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@ericsson.com> Date: Mon, 12 Aug 2024 22:23:06 +0200 Subject: [PATCH] remove satella --- CHANGELOG.md | 2 +- requirements.txt | 1 - setup.cfg | 2 +- snakehouse/satella.py | 21 ++++++++++----------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19a1465..095fab1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# v1.8 +# v2.0 * got rid of the Mako dependency * should work on latest Pythons diff --git a/requirements.txt b/requirements.txt index 5c8faf9..aed5c43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ Cython -satella>=2.20.0 MarkupSafe>=1.1.1 diff --git a/setup.cfg b/setup.cfg index e295927..3bb89eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,7 @@ name = snakehouse keywords = cython, extension, multiple, pyx version = 1.7 long_description = file: README.md -long_description-content-type = text/markdown; charset=UTF-8 +long_description_content_type = text/markdown; charset=UTF-8 license_files = LICENSE author = Piotr MaĹlanka author_email = pmaslanka@smok.co diff --git a/snakehouse/satella.py b/snakehouse/satella.py index 2453fcd..636288a 100644 --- a/snakehouse/satella.py +++ b/snakehouse/satella.py @@ -14,6 +14,14 @@ def _has_separator(path: str) -> bool: return False return any(map(lambda x: x in path, SEPARATORS)) +def _cond_join(prefix: tp.Optional[str], filename: str) -> str: + """or a conditional os.path.join""" + if prefix is None: + return filename + else: + return os.path.join(prefix, filename) + + def find_files(path: str, wildcard: str = r'(.*)', prefix_with: tp.Optional[str] = None, @@ -66,20 +74,11 @@ def split(path: str) -> tp.List[str]: Is is true that - >>> os.path.join(split(a)) == a - """ - data = list(os.path.split(path)) - while _has_separdef split(path: str) -> tp.List[str]: - """ - An exact reverse of os.path.join - - Is is true that - >>> os.path.join(split(a)) == a """ data = list(os.path.split(path)) while _has_separator(data[0]): data = list(os.path.split(data[0])) + data[1:] - return dataator(data[0]): - data = list(os.path.split(data[0])) + data[1:] return data + + -- GitLab