-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
63 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Complete annotations and add ``py.typed`` marker -- by :user:`Avasam` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
import contextlib | ||
import sys | ||
from __future__ import annotations | ||
|
||
import sys | ||
from collections.abc import Iterable | ||
from re import Match | ||
|
||
if sys.version_info >= (3, 10): | ||
import importlib.metadata as metadata | ||
else: | ||
import importlib_metadata as metadata # type: ignore # noqa: F401 | ||
import importlib.metadata as _metadata | ||
else: # pragma: no cover #jaraco/skeleton#130 | ||
import importlib_metadata as _metadata # noqa: F401 | ||
|
||
metadata = _metadata # Explicit re-export | ||
|
||
|
||
def repair_extras(extras): | ||
def repair_extras(extras: list[str] | Iterable[Match[str]]) -> list[str]: | ||
""" | ||
Repair extras that appear as match objects. | ||
python/importlib_metadata#369 revealed a flaw in the EntryPoint | ||
implementation. This function wraps the extras to ensure | ||
they are proper strings even on older implementations. | ||
""" | ||
with contextlib.suppress(AttributeError): | ||
return list(item.group(0) for item in extras) | ||
return extras | ||
try: | ||
return list(item.group(0) for item in extras) # type: ignore[union-attr] # Explicitly repairing this error | ||
except AttributeError: | ||
return extras # type: ignore[return-value] # On a single failure we assume it's all strings |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,3 @@ type = [ | |
|
||
|
||
[tool.setuptools_scm] | ||
|
||
|
||
[tool.pytest-enabler.mypy] | ||
# Disabled due to jaraco/skeleton#143 |