From 5ad259044153ccc9b727d759779a2fe51f268462 Mon Sep 17 00:00:00 2001 From: Dave Johansen Date: Fri, 8 Nov 2024 16:31:01 -0700 Subject: [PATCH] Apply pyupgrade 3.9 and EOL 3.8 https://peps.python.org/pep-0569/ --- .github/workflows/main.yml | 2 +- m3u8/version_matching.py | 6 +++--- m3u8/version_matching_rules.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd84fec3..9b4e5bd3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: # You can use PyPy versions in python-version. # For example, pypy2 and pypy3 matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/m3u8/version_matching.py b/m3u8/version_matching.py index 3d0a712f..bd7a9429 100644 --- a/m3u8/version_matching.py +++ b/m3u8/version_matching.py @@ -4,7 +4,7 @@ from m3u8.version_matching_rules import VersionMatchingError, available_rules -def get_version(file_lines: List[str]): +def get_version(file_lines: list[str]): for line in file_lines: if line.startswith(protocol.ext_x_version): version = line.split(":")[1] @@ -15,7 +15,7 @@ def get_version(file_lines: List[str]): def valid_in_all_rules( line_number: int, line: str, version: float -) -> List[VersionMatchingError]: +) -> list[VersionMatchingError]: errors = [] for rule in available_rules: validator = rule(version, line_number, line) @@ -26,7 +26,7 @@ def valid_in_all_rules( return errors -def validate(file_lines: List[str]) -> List[VersionMatchingError]: +def validate(file_lines: list[str]) -> list[VersionMatchingError]: found_version = get_version(file_lines) if found_version is None: return [] diff --git a/m3u8/version_matching_rules.py b/m3u8/version_matching_rules.py index 55be5db2..c981486b 100644 --- a/m3u8/version_matching_rules.py +++ b/m3u8/version_matching_rules.py @@ -102,7 +102,7 @@ def validate(self): return self.version >= 4 -available_rules: List[Type[VersionMatchRuleBase]] = [ +available_rules: list[type[VersionMatchRuleBase]] = [ ValidIVInEXTXKEY, ValidFloatingPointEXTINF, ValidEXTXBYTERANGEOrEXTXIFRAMESONLY, diff --git a/setup.py b/setup.py index 237d7aeb..8ec1ff96 100644 --- a/setup.py +++ b/setup.py @@ -24,5 +24,5 @@ description="Python m3u8 parser", long_description=long_description, long_description_content_type="text/markdown", - python_requires=">=3.7", + python_requires=">=3.9", )