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
632a7d80
Commit
632a7d80
authored
Aug 22, 2022
by
finswimmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat!: drop deprecated `plugin` command
parent
5f8b9da1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
268 deletions
+0
-268
src/poetry/console/application.py
+0
-4
src/poetry/console/commands/plugin/__init__.py
+0
-0
src/poetry/console/commands/plugin/add.py
+0
-64
src/poetry/console/commands/plugin/remove.py
+0
-57
src/poetry/console/commands/plugin/show.py
+0
-32
tests/console/commands/self/deprecated_plugin/__init__.py
+0
-0
tests/console/commands/self/deprecated_plugin/test_add.py
+0
-31
tests/console/commands/self/deprecated_plugin/test_remove.py
+0
-56
tests/console/commands/self/deprecated_plugin/test_show.py
+0
-24
No files found.
src/poetry/console/application.py
View file @
632a7d80
...
@@ -78,10 +78,6 @@ COMMANDS = [
...
@@ -78,10 +78,6 @@ COMMANDS = [
"env list"
,
"env list"
,
"env remove"
,
"env remove"
,
"env use"
,
"env use"
,
# Plugin commands
"plugin add"
,
"plugin remove"
,
"plugin show"
,
# Self commands
# Self commands
"self add"
,
"self add"
,
"self install"
,
"self install"
,
...
...
src/poetry/console/commands/plugin/__init__.py
deleted
100644 → 0
View file @
5f8b9da1
src/poetry/console/commands/plugin/add.py
deleted
100644 → 0
View file @
5f8b9da1
from
__future__
import
annotations
from
cleo.helpers
import
argument
from
cleo.helpers
import
option
from
cleo.io.inputs.string_input
import
StringInput
from
cleo.io.io
import
IO
from
poetry.console.commands.init
import
InitCommand
from
poetry.console.commands.self.add
import
SelfAddCommand
class
PluginAddCommand
(
InitCommand
):
name
=
"plugin add"
description
=
"Adds new plugins."
arguments
=
[
argument
(
"plugins"
,
"The names of the plugins to install."
,
multiple
=
True
),
]
options
=
[
option
(
"dry-run"
,
None
,
"Output the operations but do not execute anything (implicitly enables"
" --verbose)."
,
)
]
deprecation
=
(
"<warning>This command is deprecated. Use <c2>self add</> command instead."
"</warning>"
)
help
=
f
"""
The <c1>plugin add</c1> command installs Poetry plugins globally.
It works similarly to the <c1>add</c1> command:
{SelfAddCommand.examples}
{deprecation}
"""
hidden
=
True
def
handle
(
self
)
->
int
:
self
.
line_error
(
self
.
deprecation
)
application
=
self
.
get_application
()
command
=
application
.
find
(
"self add"
)
assert
isinstance
(
command
,
SelfAddCommand
)
application
.
configure_installer_for_command
(
command
,
self
.
io
)
argv
:
list
[
str
]
=
[
"add"
,
*
self
.
argument
(
"plugins"
)]
if
self
.
option
(
"--dry-run"
):
argv
.
append
(
"--dry-run"
)
exit_code
:
int
=
command
.
run
(
IO
(
StringInput
(
" "
.
join
(
argv
)),
self
.
io
.
output
,
self
.
io
.
error_output
,
)
)
return
exit_code
src/poetry/console/commands/plugin/remove.py
deleted
100644 → 0
View file @
5f8b9da1
from
__future__
import
annotations
from
cleo.helpers
import
argument
from
cleo.helpers
import
option
from
cleo.io.inputs.string_input
import
StringInput
from
cleo.io.io
import
IO
from
poetry.console.commands.command
import
Command
from
poetry.console.commands.self.remove
import
SelfRemoveCommand
class
PluginRemoveCommand
(
Command
):
name
=
"plugin remove"
description
=
"Removes installed plugins"
arguments
=
[
argument
(
"plugins"
,
"The names of the plugins to install."
,
multiple
=
True
),
]
options
=
[
option
(
"dry-run"
,
None
,
"Output the operations but do not execute anything (implicitly enables"
" --verbose)."
,
)
]
help
=
(
"<warning>This command is deprecated. Use <c2>self remove</> command instead."
"</warning>"
)
hidden
=
True
def
handle
(
self
)
->
int
:
self
.
line_error
(
self
.
help
)
application
=
self
.
get_application
()
command
=
application
.
find
(
"self remove"
)
assert
isinstance
(
command
,
SelfRemoveCommand
)
application
.
configure_installer_for_command
(
command
,
self
.
io
)
argv
:
list
[
str
]
=
[
"remove"
,
*
self
.
argument
(
"plugins"
)]
if
self
.
option
(
"--dry-run"
):
argv
.
append
(
"--dry-run"
)
exit_code
:
int
=
command
.
run
(
IO
(
StringInput
(
" "
.
join
(
argv
)),
self
.
io
.
output
,
self
.
io
.
error_output
,
)
)
return
exit_code
src/poetry/console/commands/plugin/show.py
deleted
100644 → 0
View file @
5f8b9da1
from
__future__
import
annotations
from
cleo.io.inputs.string_input
import
StringInput
from
cleo.io.io
import
IO
from
poetry.console.commands.command
import
Command
class
PluginShowCommand
(
Command
):
name
=
"plugin show"
description
=
"Shows information about the currently installed plugins."
help
=
(
"<warning>This command is deprecated. Use <c2>self show plugins</> "
"command instead.</warning>"
)
hidden
=
True
def
handle
(
self
)
->
int
:
self
.
line_error
(
self
.
help
)
application
=
self
.
get_application
()
command
=
application
.
find
(
"self show plugins"
)
exit_code
:
int
=
command
.
run
(
IO
(
StringInput
(
""
),
self
.
io
.
output
,
self
.
io
.
error_output
,
)
)
return
exit_code
tests/console/commands/self/deprecated_plugin/__init__.py
deleted
100644 → 0
View file @
5f8b9da1
tests/console/commands/self/deprecated_plugin/test_add.py
deleted
100644 → 0
View file @
5f8b9da1
from
__future__
import
annotations
from
typing
import
TYPE_CHECKING
import
pytest
from
poetry.core.packages.package
import
Package
from
poetry.__version__
import
__version__
if
TYPE_CHECKING
:
from
cleo.testers.command_tester
import
CommandTester
from
tests.helpers
import
TestRepository
from
tests.types
import
CommandTesterFactory
@pytest.fixture
()
def
tester
(
command_tester_factory
:
CommandTesterFactory
)
->
CommandTester
:
return
command_tester_factory
(
"plugin add"
)
def
test_deprecation_warning
(
tester
:
CommandTester
,
repo
:
TestRepository
)
->
None
:
repo
.
add_package
(
Package
(
"poetry"
,
__version__
))
repo
.
add_package
(
Package
(
"poetry-plugin"
,
"1.0"
))
tester
.
execute
(
"poetry-plugin"
)
assert
(
tester
.
io
.
fetch_error
()
==
"This command is deprecated. Use self add command instead.
\n
"
)
tests/console/commands/self/deprecated_plugin/test_remove.py
deleted
100644 → 0
View file @
5f8b9da1
from
__future__
import
annotations
from
typing
import
TYPE_CHECKING
import
pytest
from
poetry.core.packages.dependency
import
Dependency
from
poetry.core.packages.package
import
Package
from
poetry.core.packages.project_package
import
ProjectPackage
from
poetry.__version__
import
__version__
from
poetry.console.commands.self.self_command
import
SelfCommand
from
poetry.factory
import
Factory
from
tests.console.commands.self.utils
import
get_self_command_dependencies
if
TYPE_CHECKING
:
from
cleo.testers.command_tester
import
CommandTester
from
tests.helpers
import
TestRepository
from
tests.types
import
CommandTesterFactory
@pytest.fixture
()
def
tester
(
command_tester_factory
:
CommandTesterFactory
)
->
CommandTester
:
return
command_tester_factory
(
"plugin remove"
)
def
test_deprecation_warning
(
tester
:
CommandTester
,
repo
:
TestRepository
)
->
None
:
plugin
=
Package
(
"poetry-plugin"
,
"1.2.3"
)
repo
.
add_package
(
Package
(
"poetry"
,
__version__
))
repo
.
add_package
(
plugin
)
package
=
ProjectPackage
(
"poetry-instance"
,
__version__
)
package
.
add_dependency
(
Dependency
(
plugin
.
name
,
"^1.2.3"
,
groups
=
[
SelfCommand
.
ADDITIONAL_PACKAGE_GROUP
])
)
content
=
Factory
.
create_pyproject_from_package
(
package
)
system_pyproject_file
=
SelfCommand
.
get_default_system_pyproject_file
()
system_pyproject_file
.
write_text
(
content
.
as_string
(),
encoding
=
"utf-8"
)
dependencies
=
get_self_command_dependencies
(
locked
=
False
)
assert
"poetry-plugin"
in
dependencies
tester
.
execute
(
"poetry-plugin"
)
assert
(
tester
.
io
.
fetch_error
()
==
"This command is deprecated. Use self remove command instead.
\n
"
)
dependencies
=
get_self_command_dependencies
()
assert
"poetry-plugin"
not
in
dependencies
assert
not
dependencies
tests/console/commands/self/deprecated_plugin/test_show.py
deleted
100644 → 0
View file @
5f8b9da1
from
__future__
import
annotations
from
typing
import
TYPE_CHECKING
import
pytest
if
TYPE_CHECKING
:
from
cleo.testers.command_tester
import
CommandTester
from
tests.types
import
CommandTesterFactory
@pytest.fixture
()
def
tester
(
command_tester_factory
:
CommandTesterFactory
)
->
CommandTester
:
return
command_tester_factory
(
"plugin show"
)
def
test_deprecation_warning
(
tester
:
CommandTester
)
->
None
:
tester
.
execute
(
""
)
assert
(
tester
.
io
.
fetch_error
()
==
"This command is deprecated. Use self show plugins command instead.
\n
"
)
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