diff --git a/CHANGELOG.md b/CHANGELOG.md index 19a1465b81a77cd1b39cbbf847b4204f13a50dfa..095fab151d0b850f0ef4601ea8229b3f51b0eccf 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 5c8faf96594f4483362e5f1530b576fadc15abdd..aed5c43fc03c512c31bfe6d93ffcb72bfd91cbd7 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 e295927cf348e94491c55e658cb827b878cdac04..3bb89eb2908d254a09266bf37f482b25090bc6b2 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 2453fcdbe37090ffffac8fede6a58d444fa19664..636288a42183ca5f185154492d5bf7b641f1e8a3 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 + +