From fc1a323daa976dc34bf800120dbb5ead31cc77f1 Mon Sep 17 00:00:00 2001 From: sudoskys Date: Fri, 19 Jan 2024 00:10:44 +0800 Subject: [PATCH] :hammer: chore(pyproject.toml): remove loguru dependency --- pdm.lock | 41 ++----------------------------- pyproject.toml | 2 -- src/subtitle_utils/convert/bcc.py | 5 +--- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/pdm.lock b/pdm.lock index 6470f44..e58a9e2 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.1" -content_hash = "sha256:d822b9cb9c00f101a91ca70accb8ff26dae4643880ecd730a5a16c443f0b470d" +content_hash = "sha256:7707d6e978c39eecad6a65ab12453ad91de8d9607a21da9f89cc3fd546ed2840" [[package]] name = "cfgv" @@ -34,7 +34,7 @@ name = "colorama" version = "0.4.6" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" summary = "Cross-platform colored terminal text." -groups = ["default", "dev"] +groups = ["dev"] marker = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, @@ -96,21 +96,6 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] -[[package]] -name = "loguru" -version = "0.7.2" -requires_python = ">=3.5" -summary = "Python logging made (stupidly) simple" -groups = ["default"] -dependencies = [ - "colorama>=0.3.4; sys_platform == \"win32\"", - "win32-setctime>=1.0.0; sys_platform == \"win32\"", -] -files = [ - {file = "loguru-0.7.2-py3-none-any.whl", hash = "sha256:003d71e3d3ed35f0f8984898359d65b79e5b21943f78af86aa5491210429b8eb"}, - {file = "loguru-0.7.2.tar.gz", hash = "sha256:e671a53522515f34fd406340ee968cb9ecafbc4b36c679da03c18fd8d0bd51ac"}, -] - [[package]] name = "nodeenv" version = "1.8.0" @@ -136,16 +121,6 @@ files = [ {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] -[[package]] -name = "pathlib" -version = "1.0.1" -summary = "Object-oriented filesystem paths" -groups = ["default"] -files = [ - {file = "pathlib-1.0.1-py3-none-any.whl", hash = "sha256:f35f95ab8b0f59e6d354090350b44a80a80635d22efdedfa84c7ad1cf0a74147"}, - {file = "pathlib-1.0.1.tar.gz", hash = "sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f"}, -] - [[package]] name = "platformdirs" version = "4.1.0" @@ -320,15 +295,3 @@ files = [ {file = "virtualenv-20.25.0-py3-none-any.whl", hash = "sha256:4238949c5ffe6876362d9c0180fc6c3a824a7b12b80604eeb8085f2ed7460de3"}, {file = "virtualenv-20.25.0.tar.gz", hash = "sha256:bf51c0d9c7dd63ea8e44086fa1e4fb1093a31e963b86959257378aef020e1f1b"}, ] - -[[package]] -name = "win32-setctime" -version = "1.1.0" -requires_python = ">=3.5" -summary = "A small Python utility to set file creation time on Windows" -groups = ["default"] -marker = "sys_platform == \"win32\"" -files = [ - {file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"}, - {file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"}, -] diff --git a/pyproject.toml b/pyproject.toml index d43ef2f..d7fece7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,8 +7,6 @@ authors = [ { name = "KimmyXYC", email = "kimmyxyc@gmail.com" } ] dependencies = [ - "pathlib<2.0.0,>=1.0.1", - "loguru<1.0.0,>=0.6.0", "pysrt<2.0.0,>=1.1.2", "pyvtt<1.0.0,>=0.0.4", "chardet<6.0.0,>=5.1.0", diff --git a/src/subtitle_utils/convert/bcc.py b/src/subtitle_utils/convert/bcc.py index e764d80..c000985 100644 --- a/src/subtitle_utils/convert/bcc.py +++ b/src/subtitle_utils/convert/bcc.py @@ -7,8 +7,6 @@ from io import TextIOBase from typing import Union, IO -from loguru import logger - from ..parse import VttParser, BccParser, SrtParse from ..schema import Convert @@ -255,8 +253,7 @@ def vtt2bcc(self, content: Union[str, IO, TextIOBase], threshold=0.1, word=True, } ) start = sec - except Exception as e: - logger.trace(e) + except Exception: final_text = sub.text.split("\n")[-1] if caption_list and caption_list[-1]["content"] == final_text: caption_list[-1].update(