From a6420289ac6c08d8a0fcd4e1ce4171d49a790418 Mon Sep 17 00:00:00 2001 From: Jeroen Dekkers Date: Fri, 16 Feb 2024 13:02:41 +0100 Subject: [PATCH] Remove python 3.7 compatibility code and dependencies --- README.md | 2 +- setup.cfg | 8 +++----- src/abnf/__init__.py | 5 +---- src/abnf/typing.py | 5 +---- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d4da5fe..5c1e986 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The code herein has been in use in production here and there on the internet sin ## Requirements -ABNF is tested with Python 3.8-12. The package requires typing_extensions >=4, and for python 3.7, importlib_metadata. +ABNF is tested with Python 3.8-12. ## Installation diff --git a/setup.cfg b/setup.cfg index e1d79e0..8dd3924 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,10 +15,11 @@ classifiers = Topic :: Software Development :: Interpreters Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 platforms = any [options] @@ -26,10 +27,7 @@ package_dir= = src packages=find: -install_requires= - typing_extensions >=4, <5 - importlib_metadata; python_version < '3.8' -python_requires = >=3 +python_requires = >=3.8 zip_safe = False bdist_wheel = universal:1 [options.packages.find] diff --git a/src/abnf/__init__.py b/src/abnf/__init__.py index b6a87f5..0585ffd 100644 --- a/src/abnf/__init__.py +++ b/src/abnf/__init__.py @@ -2,10 +2,7 @@ import sys -if sys.version_info >= (3, 8): - from importlib.metadata import PackageNotFoundError, metadata # pragma: no cover -else: - from importlib_metadata import metadata, PackageNotFoundError # pragma: no cover +from importlib.metadata import PackageNotFoundError, metadata # pragma: no cover from abnf.parser import GrammarError, LiteralNode, Node, NodeVisitor, ParseError, Rule diff --git a/src/abnf/typing.py b/src/abnf/typing.py index a0de371..571a0a7 100644 --- a/src/abnf/typing.py +++ b/src/abnf/typing.py @@ -6,9 +6,6 @@ import sys # pragma: no cover -if sys.version_info >= (3, 8): # pragma: no cover - from typing import Protocol, runtime_checkable -else: - from typing_extensions import Protocol, runtime_checkable # pragma: no cover +from typing import Protocol, runtime_checkable __all__ = ["Protocol", "runtime_checkable"] # pragma: no cover