Remove optional status of coloredlogs

Everything optional is a possible complication.
Better to remove the option.
This commit is contained in:
James R. Barlow
2022-08-04 04:15:56 -07:00
parent 4104904a1e
commit 4d2f499f97
2 changed files with 5 additions and 11 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ project_urls =
packages = find:
install_requires =
Pillow>=8.2.0
coloredlogs>=14.0 # strictly optional
coloredlogs>=14.0
deprecation>=2.1.0
img2pdf>=0.3.0 # pure Python
packaging>=20
+4 -10
View File
@@ -15,6 +15,9 @@ from pathlib import Path
from typing import AnyStr, BinaryIO, Iterable, Union
from warnings import warn
import coloredlogs
from humanfriendly.terminal import enable_ansi_support
from ocrmypdf._logging import PageNumberFilter, TqdmConsole
from ocrmypdf._plugin_manager import get_plugin_manager
from ocrmypdf._sync import run_pipeline
@@ -22,15 +25,6 @@ from ocrmypdf._validation import check_options
from ocrmypdf.cli import ArgumentParser, get_parser
from ocrmypdf.helpers import is_iterable_notstr
try:
import coloredlogs
except ModuleNotFoundError:
coloredlogs = None # pylint: disable=invalid-name
if coloredlogs:
from humanfriendly.terminal import enable_ansi_support
StrPath = Union[Path, AnyStr]
PathOrIO = Union[BinaryIO, StrPath]
@@ -121,7 +115,7 @@ def configure_logging(
use_colors = progress_bar_friendly
formatter = None
if coloredlogs and use_colors:
if use_colors:
use_colors = enable_ansi_support()
if use_colors:
use_colors = coloredlogs.terminal_supports_colors()