Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.8 (follow-up to #308) #314

Merged
merged 2 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
rev: v3.18.0
hooks:
- id: pyupgrade
args: ['--py38-plus']
args: ['--py39-plus']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down
5 changes: 2 additions & 3 deletions binary_gentoo/internal/cli/tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from io import StringIO
from tempfile import TemporaryDirectory
from textwrap import dedent
from typing import List
from unittest import TestCase
from unittest.mock import call, patch

Expand All @@ -17,7 +16,7 @@

@dataclass
class RunRecord:
call_args_list: List["call"]
call_args_list: list["call"]


class ClassifyEmergeTargetTest(TestCase):
Expand Down Expand Up @@ -86,7 +85,7 @@ def test_portagq_interaction(self):
class MainTest(TestCase):

@staticmethod
def _run_gentoo_build_with_subprocess_mocked(argv_extra: List[str] = None) -> RunRecord:
def _run_gentoo_build_with_subprocess_mocked(argv_extra: list[str] = None) -> RunRecord:
if argv_extra is None:
argv_extra = []

Expand Down
3 changes: 1 addition & 2 deletions binary_gentoo/internal/cli/tests/test_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from io import StringIO
from itertools import product
from tempfile import TemporaryDirectory
from typing import List
from unittest import TestCase
from unittest.mock import call, patch

Expand All @@ -19,7 +18,7 @@ class RunRecord:
temp_distdir: str
temp_pkgdir: str
temp_portdir: str
call_args_list: List["call"]
call_args_list: list["call"]


class MainTest(TestCase):
Expand Down
3 changes: 1 addition & 2 deletions binary_gentoo/internal/cli/tests/test_tree_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from io import StringIO
from subprocess import call
from tempfile import TemporaryDirectory
from typing import List
from unittest import TestCase
from unittest.mock import patch

Expand All @@ -16,7 +15,7 @@

@dataclass
class RunRecord:
call_args_list: List["call"]
call_args_list: list["call"]


class MainTest(TestCase):
Expand Down
7 changes: 3 additions & 4 deletions binary_gentoo/internal/cli/tree_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import re
import sys
from argparse import ArgumentParser
from typing import Set

from ..reporter import announce_and_check_output, exception_reporting
from ._distro import HOST_IS_GENTOO
Expand All @@ -16,8 +15,8 @@
_filename_9999_pattern = re.compile(r'9999(-r[0-9]+)?\.ebuild$')


def _replace_special_keywords_for_ebuild(accept_keywords: Set[str],
ebuild_keywords: Set[str]) -> Set[str]:
def _replace_special_keywords_for_ebuild(accept_keywords: set[str],
ebuild_keywords: set[str]) -> set[str]:
effective_keywords = set(accept_keywords)
if '**' in effective_keywords:
effective_keywords.remove('**')
Expand All @@ -31,7 +30,7 @@ def _replace_special_keywords_for_ebuild(accept_keywords: Set[str],
return effective_keywords


def _get_relevant_keywords_set_for(ebuild_filepath: str, accept_keywords: Set[str]) -> Set[str]:
def _get_relevant_keywords_set_for(ebuild_filepath: str, accept_keywords: set[str]) -> set[str]:
with open(ebuild_filepath) as ifile:
ebuild_content = ifile.read()

Expand Down
5 changes: 2 additions & 3 deletions binary_gentoo/internal/priority_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import json
import os
from contextlib import suppress
from typing import List, Set

from .json_formatter import dump_json_for_humans

Expand All @@ -22,7 +21,7 @@ def _push_to_min_heap(self, prority: float, atom: str):
heapq.heappush(self._min_heap, item)
self._push_count += 1

def _remove_from_min_heap(self, atoms: Set[str]) -> Set[str]:
def _remove_from_min_heap(self, atoms: set[str]) -> set[str]:
items = []
removed_atoms = set()

Expand Down Expand Up @@ -52,7 +51,7 @@ def push(self, priority: float, atom: str):
self._priority_of[atom] = priority
self._push_to_min_heap(priority, atom)

def drop(self, atoms: List[str]):
def drop(self, atoms: list[str]):
for atom in atoms:
if atom not in self._priority_of:
raise IndexError(f'Atom {atom!r} not currently in the queue')
Expand Down