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
7ab4cf3a
Commit
7ab4cf3a
authored
Apr 24, 2022
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
application: make installer configuration public
parent
7ed1da26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
src/poetry/console/application.py
+7
-5
src/poetry/console/commands/plugin/add.py
+1
-1
src/poetry/console/commands/plugin/remove.py
+1
-1
src/poetry/console/commands/self/update.py
+1
-1
No files found.
src/poetry/console/application.py
View file @
7ab4cf3a
...
@@ -109,7 +109,7 @@ class Application(BaseApplication): # type: ignore[misc]
...
@@ -109,7 +109,7 @@ class Application(BaseApplication): # type: ignore[misc]
dispatcher
=
EventDispatcher
()
dispatcher
=
EventDispatcher
()
dispatcher
.
add_listener
(
COMMAND
,
self
.
register_command_loggers
)
dispatcher
.
add_listener
(
COMMAND
,
self
.
register_command_loggers
)
dispatcher
.
add_listener
(
COMMAND
,
self
.
configure_env
)
dispatcher
.
add_listener
(
COMMAND
,
self
.
configure_env
)
dispatcher
.
add_listener
(
COMMAND
,
self
.
configure_installer
)
dispatcher
.
add_listener
(
COMMAND
,
self
.
configure_installer
_for_event
)
self
.
set_event_dispatcher
(
dispatcher
)
self
.
set_event_dispatcher
(
dispatcher
)
command_loader
=
CommandLoader
({
name
:
load_command
(
name
)
for
name
in
COMMANDS
})
command_loader
=
CommandLoader
({
name
:
load_command
(
name
)
for
name
in
COMMANDS
})
...
@@ -301,8 +301,9 @@ class Application(BaseApplication): # type: ignore[misc]
...
@@ -301,8 +301,9 @@ class Application(BaseApplication): # type: ignore[misc]
command
.
set_env
(
env
)
command
.
set_env
(
env
)
def
configure_installer
(
@classmethod
self
,
event
:
ConsoleCommandEvent
,
event_name
:
str
,
_
:
Any
def
configure_installer_for_event
(
cls
,
event
:
ConsoleCommandEvent
,
event_name
:
str
,
_
:
Any
)
->
None
:
)
->
None
:
from
poetry.console.commands.installer_command
import
InstallerCommand
from
poetry.console.commands.installer_command
import
InstallerCommand
...
@@ -315,9 +316,10 @@ class Application(BaseApplication): # type: ignore[misc]
...
@@ -315,9 +316,10 @@ class Application(BaseApplication): # type: ignore[misc]
if
command
.
installer
is
not
None
:
if
command
.
installer
is
not
None
:
return
return
self
.
_configure_installer
(
command
,
event
.
io
)
cls
.
configure_installer_for_command
(
command
,
event
.
io
)
def
_configure_installer
(
self
,
command
:
InstallerCommand
,
io
:
IO
)
->
None
:
@staticmethod
def
configure_installer_for_command
(
command
:
InstallerCommand
,
io
:
IO
)
->
None
:
from
poetry.installation.installer
import
Installer
from
poetry.installation.installer
import
Installer
poetry
=
command
.
poetry
poetry
=
command
.
poetry
...
...
src/poetry/console/commands/plugin/add.py
View file @
7ab4cf3a
...
@@ -49,7 +49,7 @@ It works similarly to the <c1>add</c1> command:
...
@@ -49,7 +49,7 @@ It works similarly to the <c1>add</c1> command:
application
=
cast
(
Application
,
self
.
application
)
application
=
cast
(
Application
,
self
.
application
)
command
:
SelfAddCommand
=
cast
(
SelfAddCommand
,
application
.
find
(
"self add"
))
command
:
SelfAddCommand
=
cast
(
SelfAddCommand
,
application
.
find
(
"self add"
))
application
.
_configure_installer
(
command
,
self
.
io
)
application
.
configure_installer_for_command
(
command
,
self
.
io
)
argv
:
list
[
str
]
=
[
"add"
,
*
self
.
argument
(
"plugins"
)]
argv
:
list
[
str
]
=
[
"add"
,
*
self
.
argument
(
"plugins"
)]
...
...
src/poetry/console/commands/plugin/remove.py
View file @
7ab4cf3a
...
@@ -43,7 +43,7 @@ class PluginRemoveCommand(Command):
...
@@ -43,7 +43,7 @@ class PluginRemoveCommand(Command):
command
:
SelfRemoveCommand
=
cast
(
command
:
SelfRemoveCommand
=
cast
(
SelfRemoveCommand
,
application
.
find
(
"self remove"
)
SelfRemoveCommand
,
application
.
find
(
"self remove"
)
)
)
application
.
_configure_installer
(
command
,
self
.
io
)
application
.
configure_installer_for_command
(
command
,
self
.
io
)
argv
:
list
[
str
]
=
[
"remove"
,
*
self
.
argument
(
"plugins"
)]
argv
:
list
[
str
]
=
[
"remove"
,
*
self
.
argument
(
"plugins"
)]
...
...
src/poetry/console/commands/self/update.py
View file @
7ab4cf3a
...
@@ -40,7 +40,7 @@ environment.
...
@@ -40,7 +40,7 @@ environment.
application
=
cast
(
Application
,
self
.
application
)
application
=
cast
(
Application
,
self
.
application
)
add_command
:
AddCommand
=
cast
(
AddCommand
,
application
.
find
(
"add"
))
add_command
:
AddCommand
=
cast
(
AddCommand
,
application
.
find
(
"add"
))
add_command
.
set_env
(
self
.
env
)
add_command
.
set_env
(
self
.
env
)
application
.
_configure_installer
(
add_command
,
self
.
_io
)
application
.
configure_installer_for_command
(
add_command
,
self
.
_io
)
argv
=
[
"add"
,
f
"poetry@{self.argument('version')}"
]
argv
=
[
"add"
,
f
"poetry@{self.argument('version')}"
]
...
...
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