Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
7ed1da26
Commit
7ed1da26
authored
Apr 19, 2022
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin manager: use system env paths for discovery
parent
cff1baa1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
src/poetry/console/commands/self/show/plugins.py
+3
-5
src/poetry/plugins/plugin_manager.py
+14
-6
No files found.
src/poetry/console/commands/self/show/plugins.py
View file @
7ed1da26
...
...
@@ -40,12 +40,10 @@ commands respectively.
}
)
entry_points
=
(
PluginManager
(
ApplicationPlugin
.
group
)
.
get_plugin_entry_points
()
+
PluginManager
(
Plugin
.
group
)
.
get_plugin_entry_points
()
)
system_env
=
EnvManager
.
get_system_env
(
naive
=
True
)
entry_points
=
PluginManager
(
ApplicationPlugin
.
group
)
.
get_plugin_entry_points
(
env
=
system_env
)
+
PluginManager
(
Plugin
.
group
)
.
get_plugin_entry_points
(
env
=
system_env
)
installed_repository
=
InstalledRepository
.
load
(
system_env
,
with_dependencies
=
True
)
...
...
src/poetry/plugins/plugin_manager.py
View file @
7ed1da26
from
__future__
import
annotations
import
logging
import
sys
from
typing
import
Any
from
typing
import
TYPE_CHECKING
import
entrypoints
...
...
@@ -10,6 +11,12 @@ from poetry.plugins.application_plugin import ApplicationPlugin
from
poetry.plugins.plugin
import
Plugin
if
TYPE_CHECKING
:
from
typing
import
Any
from
poetry.utils.env
import
Env
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -23,19 +30,20 @@ class PluginManager:
self
.
_disable_plugins
=
disable_plugins
self
.
_plugins
:
list
[
Plugin
]
=
[]
def
load_plugins
(
self
)
->
None
:
def
load_plugins
(
self
,
env
:
Env
|
None
=
None
)
->
None
:
if
self
.
_disable_plugins
:
return
plugin_entrypoints
=
self
.
get_plugin_entry_points
()
plugin_entrypoints
=
self
.
get_plugin_entry_points
(
env
=
env
)
for
entrypoint
in
plugin_entrypoints
:
self
.
_load_plugin_entrypoint
(
entrypoint
)
def
get_plugin_entry_points
(
self
)
->
list
[
entrypoints
.
EntryPoint
]:
def
get_plugin_entry_points
(
self
,
env
:
Env
|
None
=
None
)
->
list
[
entrypoints
.
EntryPoint
]:
entry_points
:
list
[
entrypoints
.
EntryPoint
]
=
entrypoints
.
get_group_all
(
self
.
_group
self
.
_group
,
path
=
env
.
sys_path
if
env
else
sys
.
path
)
return
entry_points
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment