diff --git a/jaraco/text/__init__.py b/jaraco/text/__init__.py index 42666e9..e786f8a 100644 --- a/jaraco/text/__init__.py +++ b/jaraco/text/__init__.py @@ -7,14 +7,7 @@ import textwrap from collections.abc import Callable, Generator, Iterable, Sequence from importlib.resources import files -from typing import ( - TYPE_CHECKING, - Literal, - Protocol, - SupportsIndex, - TypeVar, - overload, -) +from typing import TYPE_CHECKING, Literal, Protocol, SupportsIndex, TypeVar, overload from jaraco.context import ExceptionTrap from jaraco.functools import compose, method_cache diff --git a/jaraco/text/show-newlines.py b/jaraco/text/show-newlines.py index e3d1c67..20538eb 100644 --- a/jaraco/text/show-newlines.py +++ b/jaraco/text/show-newlines.py @@ -1,8 +1,8 @@ from __future__ import annotations +import sys from typing import TYPE_CHECKING -import autocommand import inflect from more_itertools import always_iterable @@ -37,4 +37,4 @@ def report_newlines(filename: FileDescriptorOrPath) -> None: ) -autocommand.autocommand(__name__)(report_newlines) +__name__ == '__main__' and report_newlines(*sys.argv[1:]) # type: ignore[func-returns-value] diff --git a/jaraco/text/strip-prefix.py b/jaraco/text/strip-prefix.py index 3ca85a9..0101278 100644 --- a/jaraco/text/strip-prefix.py +++ b/jaraco/text/strip-prefix.py @@ -1,7 +1,5 @@ import sys -import autocommand - from jaraco.text import Stripper @@ -18,4 +16,4 @@ def strip_prefix() -> None: sys.stdout.writelines(Stripper.strip_prefix(sys.stdin).lines) -autocommand.autocommand(__name__)(strip_prefix) +__name__ == '__main__' and strip_prefix() # type: ignore[func-returns-value] diff --git a/newsfragments/26.feature.rst b/newsfragments/26.feature.rst new file mode 100644 index 0000000..83c0d81 --- /dev/null +++ b/newsfragments/26.feature.rst @@ -0,0 +1 @@ +Removed ``autocommand`` as a dependency -- by :user:`Avasam` diff --git a/pyproject.toml b/pyproject.toml index bb42d09..428997b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ license = "MIT" dependencies = [ "jaraco.functools", "jaraco.context >= 4.1", - "autocommand", "more_itertools", ] dynamic = ["version"]