-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Validate the path types of the entry-points - Update the entry-points values with the settings value - Flatten the entry-points to a list or add them as a dict - Print more debug messages - Fix the settings type to string Signed-off-by: Cristian Le <[email protected]>
- Loading branch information
Showing
5 changed files
with
106 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from pathlib import Path | ||
|
||
if sys.version_info < (3, 10): | ||
# Readers and MultiplexedPath were introduced in 3.10, so nothing should output a MultiplexedPath | ||
# It is also tricky because it is unclear if the `resource_loader` when calling `import` would create | ||
# either importlib.readers.MultiplexedPath or importlib_resources.MultiplexedPath. | ||
# Creating a dummy class instead so that if it fails, it fails completely (and mypy is made happy) | ||
class MultiplexedPath: | ||
_paths: list[Path] | ||
else: | ||
# From 3.11 it is accessed as importlib.resources.readers | ||
from importlib.readers import MultiplexedPath | ||
|
||
__all__ = ["MultiplexedPath"] | ||
|
||
|
||
def __dir__() -> list[str]: | ||
return __all__ |
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