Skip to content
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
11 changes: 7 additions & 4 deletions ebuild/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import importlib.metadata
import logging
from typing import List
from typing import Any, List, Mapping, cast

from ebuild.plugins.base import PluginBase

Expand Down Expand Up @@ -41,9 +41,12 @@ def discover_plugins() -> List[PluginBase]:
if hasattr(entry_points, "select"):
eps = entry_points.select(group="ebuild.plugins")
else:
# Before 3.10 entry_points() returned a dict; the current stubs
# only model EntryPoints, which has no .get, hence the ignore.
eps = entry_points.get("ebuild.plugins", []) # type: ignore[attr-defined]
# Before 3.10, entry_points() returned a mapping of group name
# to entry points. The stubs only model the modern EntryPoints, so
# spell the old shape out rather than widen the ignore: the
# `# type: ignore[attr-defined]` that was here named the wrong
# error code, and mypy failed on the line anyway.
eps = cast(Mapping[str, Any], entry_points).get("ebuild.plugins", [])

for ep in eps:
try:
Expand Down
1 change: 0 additions & 1 deletion tests/ebuild/test_build_dir_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import os
import shutil
import subprocess
import shutil
import textwrap
from pathlib import Path
from types import SimpleNamespace
Expand Down
2 changes: 1 addition & 1 deletion tests/ebuild/test_package_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ def test_depends_alias_must_be_a_list():
"""

with pytest.raises(RecipeError, match="dependencies"):
load_recipe_from_string(content)
load_recipe_from_string(content)
8 changes: 4 additions & 4 deletions tests/unit/test_ci_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
required check does not cover.
"""

import itertools
import re
from pathlib import Path

import yaml
import pytest
from pathlib import Path


WORKFLOWS_DIR = Path(__file__).resolve().parents[2] / ".github" / "workflows"
Expand Down Expand Up @@ -211,9 +214,6 @@ def test_gate_fails_on_any_non_success_result(jobs):
# check cannot say which of the three it means, and a Windows-only failure is
# indistinguishable from the other two legs without opening the run.

import itertools
import re

# `include` and `exclude` shape a matrix but are not dimensions of it, so they
# are not part of the cartesian product.
_NOT_A_DIMENSION = {"include", "exclude"}
Expand Down
Loading