From f8b62bfd107e9f8318c6a538fe2c9e8bc26af41d Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 21 Jul 2024 22:51:48 -0400 Subject: [PATCH] Drop dependency on `inflect` --- jaraco/text/show-newlines.py | 5 +---- newsfragments/16.misc.rst | 1 + pyproject.toml | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 newsfragments/16.misc.rst diff --git a/jaraco/text/show-newlines.py b/jaraco/text/show-newlines.py index ef4cc54..eac33a4 100644 --- a/jaraco/text/show-newlines.py +++ b/jaraco/text/show-newlines.py @@ -1,5 +1,4 @@ import autocommand -import inflect from more_itertools import always_iterable import jaraco.text @@ -21,10 +20,8 @@ def report_newlines(filename): """ newlines = jaraco.text.read_newlines(filename) count = len(tuple(always_iterable(newlines))) - engine = inflect.engine() print( - engine.plural_noun("newline", count), - engine.plural_verb("is", count), + *(("newline", "is") if count == 1 else ("newlines", "are")), repr(newlines), ) diff --git a/newsfragments/16.misc.rst b/newsfragments/16.misc.rst new file mode 100644 index 0000000..27134af --- /dev/null +++ b/newsfragments/16.misc.rst @@ -0,0 +1 @@ +Drop dependency on ``inflect`` -- by :user:`Avasam` diff --git a/pyproject.toml b/pyproject.toml index e96d197..a10291c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ dependencies = [ "jaraco.context >= 4.1", 'importlib_resources; python_version < "3.9"', "autocommand", - "inflect", "more_itertools", ] dynamic = ["version"]