Add option --plugin-dirs (#11277)
Closes #3260 Authored by: imranh2, coletdjnz Co-authored-by: coletdjnz <coletdjnz@protonmail.com>
This commit is contained in:
parent
8de431ec97
commit
0f593dca9f
7 changed files with 55 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ from zipfile import ZipFile
|
|||
|
||||
from .compat import functools # isort: split
|
||||
from .utils import (
|
||||
Config,
|
||||
get_executable_path,
|
||||
get_system_config_dirs,
|
||||
get_user_config_dirs,
|
||||
|
|
@ -84,6 +85,12 @@ class PluginFinder(importlib.abc.MetaPathFinder):
|
|||
with contextlib.suppress(ValueError): # Added when running __main__.py directly
|
||||
candidate_locations.remove(Path(__file__).parent)
|
||||
|
||||
# TODO(coletdjnz): remove when plugin globals system is implemented
|
||||
if Config._plugin_dirs:
|
||||
candidate_locations.extend(_get_package_paths(
|
||||
*Config._plugin_dirs,
|
||||
containing_folder=''))
|
||||
|
||||
parts = Path(*fullname.split('.'))
|
||||
for path in orderedSet(candidate_locations, lazy=True):
|
||||
candidate = path / parts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue