Skip to content

Commit

Permalink
Merge pull request #23 from dekkers/remove-py37-compatibility
Browse files Browse the repository at this point in the history
Remove Python 3.7 compatibility code and dependencies
  • Loading branch information
declaresub authored Feb 16, 2024
2 parents 973efdd + a642028 commit b173d59
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@ 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]
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]
Expand Down
5 changes: 1 addition & 4 deletions src/abnf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions src/abnf/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b173d59

Please sign in to comment.