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
5fc50555
Unverified
Commit
5fc50555
authored
May 16, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update commands to use new Cleo helpers
parent
51bd2283
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
339 additions
and
217 deletions
+339
-217
poetry.lock
+6
-6
poetry/console/application.py
+0
-4
poetry/console/commands/__init__.py
+0
-2
poetry/console/commands/about.py
+3
-4
poetry/console/commands/add.py
+39
-16
poetry/console/commands/build.py
+8
-5
poetry/console/commands/cache/cache.py
+2
-4
poetry/console/commands/cache/clear.py
+8
-6
poetry/console/commands/check.py
+2
-4
poetry/console/commands/config.py
+16
-9
poetry/console/commands/debug/debug.py
+2
-4
poetry/console/commands/debug/info.py
+2
-5
poetry/console/commands/debug/resolve.py
+22
-10
poetry/console/commands/env/env.py
+2
-4
poetry/console/commands/env/info.py
+6
-5
poetry/console/commands/env/list.py
+6
-5
poetry/console/commands/env/remove.py
+8
-5
poetry/console/commands/env/use.py
+6
-5
poetry/console/commands/export.py
+10
-8
poetry/console/commands/init.py
+30
-13
poetry/console/commands/install.py
+31
-12
poetry/console/commands/lock.py
+2
-4
poetry/console/commands/new.py
+11
-7
poetry/console/commands/publish.py
+14
-9
poetry/console/commands/remove.py
+17
-9
poetry/console/commands/run.py
+8
-5
poetry/console/commands/search.py
+8
-6
poetry/console/commands/self/self.py
+1
-3
poetry/console/commands/self/update.py
+8
-6
poetry/console/commands/shell.py
+2
-4
poetry/console/commands/show.py
+23
-12
poetry/console/commands/update.py
+22
-10
poetry/console/commands/version.py
+13
-5
pyproject.toml
+1
-1
No files found.
poetry.lock
View file @
5fc50555
...
@@ -123,10 +123,10 @@ description = "Cleo allows you to create beautiful and testable command-line int
...
@@ -123,10 +123,10 @@ description = "Cleo allows you to create beautiful and testable command-line int
name = "cleo"
name = "cleo"
optional = false
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "0.7.
2
"
version = "0.7.
4
"
[package.dependencies]
[package.dependencies]
clikit = ">=0.2.
0
,<0.3.0"
clikit = ">=0.2.
4
,<0.3.0"
pastel = ">=0.1.0,<0.2.0"
pastel = ">=0.1.0,<0.2.0"
pylev = ">=1.3,<2.0"
pylev = ">=1.3,<2.0"
...
@@ -145,7 +145,7 @@ description = "CliKit is a group of utilities to build beautiful and testable co
...
@@ -145,7 +145,7 @@ description = "CliKit is a group of utilities to build beautiful and testable co
name = "clikit"
name = "clikit"
optional = false
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "0.2.
3
"
version = "0.2.
4
"
[package.dependencies]
[package.dependencies]
pastel = ">=0.1.0,<0.2.0"
pastel = ">=0.1.0,<0.2.0"
...
@@ -923,7 +923,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
...
@@ -923,7 +923,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs", "pytest-flake8", "pathlib2", "more-itertools"]
testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs", "pytest-flake8", "pathlib2", "more-itertools"]
[metadata]
[metadata]
content-hash = "
9485e088cf3b45d2cff74b6dc625373d9aee736721cc4ae0cb9c951e829a03c6
"
content-hash = "
f3163ab56506c745d9250f9c04ea512d4996068c85770092590ffb079b465db0
"
python-versions = "~2.7 || ^3.4"
python-versions = "~2.7 || ^3.4"
[metadata.hashes]
[metadata.hashes]
...
@@ -937,9 +937,9 @@ cachy = ["b71513e5a38ce90c1280c02b7d8d6bb3fdf64666c9cc0584f2479afea097d56c", "b7
...
@@ -937,9 +937,9 @@ cachy = ["b71513e5a38ce90c1280c02b7d8d6bb3fdf64666c9cc0584f2479afea097d56c", "b7
certifi = ["59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5", "b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae"]
certifi = ["59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5", "b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae"]
cfgv = ["6e9f2feea5e84bc71e56abd703140d7a2c250fc5ba38b8702fd6a68ed4e3b2ef", "e7f186d4a36c099a9e20b04ac3108bd8bb9b9257e692ce18c8c3764d5cb12172"]
cfgv = ["6e9f2feea5e84bc71e56abd703140d7a2c250fc5ba38b8702fd6a68ed4e3b2ef", "e7f186d4a36c099a9e20b04ac3108bd8bb9b9257e692ce18c8c3764d5cb12172"]
chardet = ["84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", "fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"]
chardet = ["84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", "fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"]
cleo = ["
7a5000de616de42fd78f968192651b9174bf333a9079fc9d68ccc672ddfd3624", "a39fa806fd3f64ff0ae4e3a55bb80c8ce60ca73634e13619731d63a04a63be69
"]
cleo = ["
58d26642fa608a1515093275cd98875100c7d50f01fc1f3bbb7a78dbb73e4b14", "9b7d706309412e43d00723ed3074a300cd7879a0c685f4fef0b5052d7f4ab71f
"]
click = ["2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", "5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"]
click = ["2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", "5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"]
clikit = ["
7bbd38fcb912058c689a03f487a66f8d1eb1f486bc5cf68d4a5798093bd0217f", "e23ac911afb7079ae0e4d89af73ee0d31c8952c64ef4fcf76bcd46bfde9aabaa
"]
clikit = ["
a7597999555aeb2ce9946f07187f690ab6864213f337e51250178c4bd19bd810", "d6807cf4a41e6b981b056075c0aefca2db1dabc597ed18fa4d92b8b2e2678835
"]
colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"]
colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"]
configparser = ["8be81d89d6e7b4c0d4e44bcc525845f6da25821de80cb5e06e7e0238a2899e32", "da60d0014fd8c55eb48c1c5354352e363e2d30bbf7057e5e171a468390184c75"]
configparser = ["8be81d89d6e7b4c0d4e44bcc525845f6da25821de80cb5e06e7e0238a2899e32", "da60d0014fd8c55eb48c1c5354352e363e2d30bbf7057e5e171a468390184c75"]
contextlib2 = ["509f9419ee91cdd00ba34443217d5ca51f5a364a404e1dce9e8979cea969ca48", "f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00"]
contextlib2 = ["509f9419ee91cdd00ba34443217d5ca51f5a364a404e1dce9e8979cea969ca48", "f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00"]
...
...
poetry/console/application.py
View file @
5fc50555
...
@@ -9,7 +9,6 @@ from .commands import AddCommand
...
@@ -9,7 +9,6 @@ from .commands import AddCommand
from
.commands
import
BuildCommand
from
.commands
import
BuildCommand
from
.commands
import
CheckCommand
from
.commands
import
CheckCommand
from
.commands
import
ConfigCommand
from
.commands
import
ConfigCommand
from
.commands
import
DevelopCommand
from
.commands
import
ExportCommand
from
.commands
import
ExportCommand
from
.commands
import
InitCommand
from
.commands
import
InitCommand
from
.commands
import
InstallCommand
from
.commands
import
InstallCommand
...
@@ -18,7 +17,6 @@ from .commands import NewCommand
...
@@ -18,7 +17,6 @@ from .commands import NewCommand
from
.commands
import
PublishCommand
from
.commands
import
PublishCommand
from
.commands
import
RemoveCommand
from
.commands
import
RemoveCommand
from
.commands
import
RunCommand
from
.commands
import
RunCommand
from
.commands
import
ScriptCommand
from
.commands
import
SearchCommand
from
.commands
import
SearchCommand
from
.commands
import
ShellCommand
from
.commands
import
ShellCommand
from
.commands
import
ShowCommand
from
.commands
import
ShowCommand
...
@@ -68,7 +66,6 @@ class Application(BaseApplication):
...
@@ -68,7 +66,6 @@ class Application(BaseApplication):
BuildCommand
(),
BuildCommand
(),
CheckCommand
(),
CheckCommand
(),
ConfigCommand
(),
ConfigCommand
(),
DevelopCommand
(),
ExportCommand
(),
ExportCommand
(),
InitCommand
(),
InitCommand
(),
InstallCommand
(),
InstallCommand
(),
...
@@ -77,7 +74,6 @@ class Application(BaseApplication):
...
@@ -77,7 +74,6 @@ class Application(BaseApplication):
PublishCommand
(),
PublishCommand
(),
RemoveCommand
(),
RemoveCommand
(),
RunCommand
(),
RunCommand
(),
ScriptCommand
(),
SearchCommand
(),
SearchCommand
(),
ShellCommand
(),
ShellCommand
(),
ShowCommand
(),
ShowCommand
(),
...
...
poetry/console/commands/__init__.py
View file @
5fc50555
...
@@ -3,7 +3,6 @@ from .add import AddCommand
...
@@ -3,7 +3,6 @@ from .add import AddCommand
from
.build
import
BuildCommand
from
.build
import
BuildCommand
from
.check
import
CheckCommand
from
.check
import
CheckCommand
from
.config
import
ConfigCommand
from
.config
import
ConfigCommand
from
.develop
import
DevelopCommand
from
.export
import
ExportCommand
from
.export
import
ExportCommand
from
.init
import
InitCommand
from
.init
import
InitCommand
from
.install
import
InstallCommand
from
.install
import
InstallCommand
...
@@ -12,7 +11,6 @@ from .new import NewCommand
...
@@ -12,7 +11,6 @@ from .new import NewCommand
from
.publish
import
PublishCommand
from
.publish
import
PublishCommand
from
.remove
import
RemoveCommand
from
.remove
import
RemoveCommand
from
.run
import
RunCommand
from
.run
import
RunCommand
from
.script
import
ScriptCommand
from
.search
import
SearchCommand
from
.search
import
SearchCommand
from
.shell
import
ShellCommand
from
.shell
import
ShellCommand
from
.show
import
ShowCommand
from
.show
import
ShowCommand
...
...
poetry/console/commands/about.py
View file @
5fc50555
...
@@ -2,11 +2,10 @@ from .command import Command
...
@@ -2,11 +2,10 @@ from .command import Command
class
AboutCommand
(
Command
):
class
AboutCommand
(
Command
):
"""
Short information about Poetry.
about
name
=
"about"
"""
description
=
"Short information about Poetry."
def
handle
(
self
):
def
handle
(
self
):
self
.
line
(
self
.
line
(
...
...
poetry/console/commands/add.py
View file @
5fc50555
from
cleo
import
argument
from
cleo
import
option
from
.init
import
InitCommand
from
.init
import
InitCommand
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
AddCommand
(
EnvCommand
,
InitCommand
):
class
AddCommand
(
EnvCommand
,
InitCommand
):
"""
Add a new dependency to <comment>pyproject.toml</>.
name
=
"add"
description
=
"Add a new dependency to <comment>pyproject.toml</>."
add
{ name* : Packages to add. }
arguments
=
[
argument
(
"name"
,
"Packages to add."
,
multiple
=
True
)]
{ --D|dev : Add package as development dependency. }
options
=
[
{ --git= : The url of the Git repository. }
option
(
"dev"
,
"D"
,
"Add package as development dependency."
),
{ --path= : The path to a dependency. }
option
(
"git"
,
None
,
"The url of the Git repository."
,
flag
=
False
),
{ --E|extras=* : Extras to activate for the dependency. }
option
(
"path"
,
None
,
"The path to a dependency."
,
flag
=
False
),
{ --optional : Add as an optional dependency. }
option
(
{ --python= : Python version( for which the dependencies must be installed. }
"extras"
,
{ --platform= : Platforms for which the dependencies must be installed. }
"E"
,
{ --allow-prereleases : Accept prereleases. }
"Extras to activate for the dependency."
,
{ --dry-run : Outputs the operations but will not execute anything
flag
=
False
,
(implicitly enables --verbose). }
multiple
=
True
,
"""
),
option
(
"optional"
,
None
,
"Add as an optional dependency."
),
option
(
"python"
,
None
,
"Python version for which the dependencies must be installed."
,
flag
=
False
,
),
option
(
"platform"
,
None
,
"Platforms for which the dependencies must be installed."
,
flag
=
False
,
),
option
(
"allow-prereleases"
,
None
,
"Accept prereleases."
),
option
(
"dry-run"
,
None
,
"Outputs the operations but will not execute anything (implicitly enables --verbose)."
,
),
]
help
=
"""The add command adds required packages to your <comment>pyproject.toml</> and installs them.
help
=
"""The add command adds required packages to your <comment>pyproject.toml</> and installs them.
...
...
poetry/console/commands/build.py
View file @
5fc50555
from
cleo
import
option
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
BuildCommand
(
EnvCommand
):
class
BuildCommand
(
EnvCommand
):
"""
Builds a package, as a tarball and a wheel by default.
build
name
=
"build"
{ --f|format= : Limit the format to either wheel or sdist. }
description
=
"Builds a package, as a tarball and a wheel by default."
"""
options
=
[
option
(
"format"
,
"f"
,
"Limit the format to either wheel or sdist."
,
flag
=
True
)
]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.masonry
import
Builder
from
poetry.masonry
import
Builder
...
...
poetry/console/commands/cache/cache.py
View file @
5fc50555
...
@@ -4,11 +4,9 @@ from .clear import CacheClearCommand
...
@@ -4,11 +4,9 @@ from .clear import CacheClearCommand
class
CacheCommand
(
Command
):
class
CacheCommand
(
Command
):
"""
Interact with Poetry's cache.
cache
name
=
"cache"
""
"
description
=
"Interact with Poetry's cache
"
commands
=
[
CacheClearCommand
()]
commands
=
[
CacheClearCommand
()]
...
...
poetry/console/commands/cache/clear.py
View file @
5fc50555
import
os
import
os
from
cleo
import
argument
from
cleo
import
option
from
..command
import
Command
from
..command
import
Command
class
CacheClearCommand
(
Command
):
class
CacheClearCommand
(
Command
):
"""
Clears poetry's cache.
clear
name
=
"clear"
{ cache : The name of the cache to clear. }
description
=
"Clears Poetry's cache."
{ --all : Clear all caches. }
"""
arguments
=
[
argument
(
"cache"
,
description
=
"The name of the cache to clear."
)]
options
=
[
option
(
"all"
,
description
=
"Clear all caches."
)]
def
handle
(
self
):
def
handle
(
self
):
from
cachy
import
CacheManager
from
cachy
import
CacheManager
...
...
poetry/console/commands/check.py
View file @
5fc50555
...
@@ -2,11 +2,9 @@ from .command import Command
...
@@ -2,11 +2,9 @@ from .command import Command
class
CheckCommand
(
Command
):
class
CheckCommand
(
Command
):
"""
Checks the validity of the <comment>pyproject.toml</comment> file.
check
name
=
"check"
""
"
description
=
"Checks the validity of the <comment>pyproject.toml</comment> file.
"
def
handle
(
self
):
def
handle
(
self
):
# Load poetry and display errors, if any
# Load poetry and display errors, if any
...
...
poetry/console/commands/config.py
View file @
5fc50555
import
json
import
json
import
re
import
re
from
cleo
import
argument
from
cleo
import
option
from
.command
import
Command
from
.command
import
Command
...
@@ -14,15 +17,19 @@ AUTH_TEMPLATE = """[http-basic]
...
@@ -14,15 +17,19 @@ AUTH_TEMPLATE = """[http-basic]
class
ConfigCommand
(
Command
):
class
ConfigCommand
(
Command
):
"""
Sets/Gets config options.
name
=
"config"
description
=
"Sets/Gets config options."
config
{ key? : Setting key. }
arguments
=
[
{ value?* : Setting value. }
argument
(
"key"
,
"Setting key."
,
optional
=
True
),
{ --list : List configuration settings }
argument
(
"value"
,
"Setting value."
,
optional
=
True
,
multiple
=
True
),
{ --unset : Unset configuration setting }
]
"""
options
=
[
option
(
"list"
,
None
,
"List configuration settings."
),
option
(
"unset"
,
None
,
"Unset configuration setting."
),
]
help
=
"""This command allows you to edit the poetry config settings and repositories.
help
=
"""This command allows you to edit the poetry config settings and repositories.
...
...
poetry/console/commands/debug/debug.py
View file @
5fc50555
...
@@ -4,10 +4,8 @@ from .resolve import DebugResolveCommand
...
@@ -4,10 +4,8 @@ from .resolve import DebugResolveCommand
class
DebugCommand
(
Command
):
class
DebugCommand
(
Command
):
"""
Debug various elements of Poetry.
debug
name
=
"debug"
""
"
description
=
"Debug various elements of Poetry.
"
commands
=
[
DebugInfoCommand
()
.
default
(),
DebugResolveCommand
()]
commands
=
[
DebugInfoCommand
()
.
default
(),
DebugResolveCommand
()]
poetry/console/commands/debug/info.py
View file @
5fc50555
import
os
import
sys
import
sys
from
clikit.args
import
StringArgs
from
clikit.args
import
StringArgs
...
@@ -7,11 +6,9 @@ from ..command import Command
...
@@ -7,11 +6,9 @@ from ..command import Command
class
DebugInfoCommand
(
Command
):
class
DebugInfoCommand
(
Command
):
"""
Shows debug information.
info
name
=
"info"
""
"
description
=
"Shows debug information.
"
def
handle
(
self
):
def
handle
(
self
):
poetry_python_version
=
"."
.
join
(
str
(
s
)
for
s
in
sys
.
version_info
[:
3
])
poetry_python_version
=
"."
.
join
(
str
(
s
)
for
s
in
sys
.
version_info
[:
3
])
...
...
poetry/console/commands/debug/resolve.py
View file @
5fc50555
...
@@ -2,20 +2,32 @@ import re
...
@@ -2,20 +2,32 @@ import re
from
typing
import
List
from
typing
import
List
from
cleo
import
argument
from
cleo
import
option
from
..command
import
Command
from
..command
import
Command
class
DebugResolveCommand
(
Command
):
class
DebugResolveCommand
(
Command
):
"""
Debugs dependency resolution.
name
=
"resolve"
description
=
"Debugs dependency resolution."
resolve
{ package?* : packages to resolve. }
arguments
=
[
{ --E|extras=* : Extras to activate for the dependency. }
argument
(
"package"
,
"Packages to resolve."
,
optional
=
True
,
multiple
=
True
)
{ --python= : Python version(s) to use for resolution. }
]
{ --tree : Displays the dependency tree. }
options
=
[
{ --install : Show what would be installed for the current system. }
option
(
"""
"extras"
,
"E"
,
"Extras to activate for the dependency."
,
flag
=
False
,
multiple
=
True
,
),
option
(
"python"
,
None
,
"Python version(s) to use for resolution."
,
flag
=
False
),
option
(
"tree"
,
None
,
"Displays the dependency tree."
),
option
(
"install"
,
None
,
"Show what would be installed for the current system."
),
]
loggers
=
[
"poetry.repositories.pypi_repository"
]
loggers
=
[
"poetry.repositories.pypi_repository"
]
...
...
poetry/console/commands/env/env.py
View file @
5fc50555
...
@@ -7,11 +7,9 @@ from .use import EnvUseCommand
...
@@ -7,11 +7,9 @@ from .use import EnvUseCommand
class
EnvCommand
(
Command
):
class
EnvCommand
(
Command
):
"""
Interact with Poetry's project environments.
env
name
=
"env"
""
"
description
=
"Interact with Poetry's project environments.
"
commands
=
[
EnvInfoCommand
(),
EnvListCommand
(),
EnvRemoveCommand
(),
EnvUseCommand
()]
commands
=
[
EnvInfoCommand
(),
EnvListCommand
(),
EnvRemoveCommand
(),
EnvUseCommand
()]
...
...
poetry/console/commands/env/info.py
View file @
5fc50555
from
cleo
import
option
from
..command
import
Command
from
..command
import
Command
class
EnvInfoCommand
(
Command
):
class
EnvInfoCommand
(
Command
):
"""
Display information about the current environment.
info
name
=
"info"
{--p|path : Only display the environment's path}
description
=
"Display information about the current environment."
"""
options
=
[
option
(
"path"
,
"p"
,
"Only display the environment's path."
)]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.utils.env
import
EnvManager
from
poetry.utils.env
import
EnvManager
...
...
poetry/console/commands/env/list.py
View file @
5fc50555
from
cleo
import
option
from
..command
import
Command
from
..command
import
Command
class
EnvListCommand
(
Command
):
class
EnvListCommand
(
Command
):
"""
List all virtualenvs associated with the current project.
list
name
=
"list"
{--full-path : Output the full paths of the virtualenvs}
description
=
"List all virtualenvs associated with the current project."
"""
options
=
[
option
(
"full-path"
,
None
,
"Output the full paths of the virtualenvs."
)]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.utils.env
import
EnvManager
from
poetry.utils.env
import
EnvManager
...
...
poetry/console/commands/env/remove.py
View file @
5fc50555
from
cleo
import
argument
from
..command
import
Command
from
..command
import
Command
class
EnvRemoveCommand
(
Command
):
class
EnvRemoveCommand
(
Command
):
"""
Remove a specific virtualenv associated with the project.
remove
name
=
"remove"
{python : The python executable to remove the virtualenv for.}
description
=
"Remove a specific virtualenv associated with the project."
"""
arguments
=
[
argument
(
"python"
,
"The python executable to remove the virtualenv for."
)
]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.utils.env
import
EnvManager
from
poetry.utils.env
import
EnvManager
...
...
poetry/console/commands/env/use.py
View file @
5fc50555
from
cleo
import
argument
from
..command
import
Command
from
..command
import
Command
class
EnvUseCommand
(
Command
):
class
EnvUseCommand
(
Command
):
"""
Activate or create a new virtualenv for the current project.
use
name
=
"use"
{python : The python executable to use.}
description
=
"Activate or create a new virtualenv for the current project."
"""
arguments
=
[
argument
(
"python"
,
"The python executable to use."
)]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.utils.env
import
EnvManager
from
poetry.utils.env
import
EnvManager
...
...
poetry/console/commands/export.py
View file @
5fc50555
from
poetry.utils.exporter
import
Exporter
from
poetry.utils.exporter
import
Exporter
from
cleo
import
option
from
.command
import
Command
from
.command
import
Command
class
ExportCommand
(
Command
):
class
ExportCommand
(
Command
):
"""
Exports the lock file to alternative formats.
name
=
"export"
description
=
"Exports the lock file to alternative formats."
export
{--f|format= : Format to export to.}
options
=
[
{--without-hashes : Exclude hashes from the exported file.}
option
(
"format"
,
"f"
,
"Format to export to."
,
flag
=
False
),
{--dev : Include development dependencies.}
option
(
"without-hashes"
,
None
,
"Exclude hashes from the exported file."
),
"""
option
(
"dev"
,
None
,
"Include development dependencies."
),
]
def
handle
(
self
):
def
handle
(
self
):
fmt
=
self
.
option
(
"format"
)
fmt
=
self
.
option
(
"format"
)
...
...
poetry/console/commands/init.py
View file @
5fc50555
...
@@ -6,24 +6,41 @@ import re
...
@@ -6,24 +6,41 @@ import re
from
typing
import
List
from
typing
import
List
from
typing
import
Tuple
from
typing
import
Tuple
from
cleo
import
option
from
.command
import
Command
from
.command
import
Command
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
InitCommand
(
Command
):
class
InitCommand
(
Command
):
"""
Creates a basic <comment>pyproject.toml</> file in the current directory.
name
=
"init"
description
=
(
init
"Creates a basic <comment>pyproject.toml</> file in the current directory."
{--name= : Name of the package}
)
{--description= : Description of the package}
{--author= : Author name of the package}
options
=
[
{--dependency=* : Package to require with an optional version constraint,
option
(
"name"
,
None
,
"Name of the package."
,
flag
=
False
),
e.g. requests:^2.10.0 or requests=2.11.1}
option
(
"description"
,
None
,
"Description of the package."
,
flag
=
False
),
{--dev-dependency=* : Package to require for development with an optional version constraint,
option
(
"author"
,
None
,
"Author name of the package."
,
flag
=
False
),
e.g. requests:^2.10.0 or requests=2.11.1}
option
(
{--l|license= : License of the package}
"dependency"
,
"""
None
,
"Package to require with an optional version constraint, "
"e.g. requests:^2.10.0 or requests=2.11.1."
,
flag
=
False
,
multiple
=
True
,
),
option
(
"dev-dependency"
,
None
,
"Package to require for development with an optional version constraint, "
"e.g. requests:^2.10.0 or requests=2.11.1."
,
flag
=
False
,
multiple
=
True
,
),
option
(
"license"
,
"l"
,
"License of the package."
,
flag
=
False
),
]
help
=
"""
\
help
=
"""
\
The <info>init</info> command creates a basic <comment>pyproject.toml</> file in the current directory.
The <info>init</info> command creates a basic <comment>pyproject.toml</> file in the current directory.
...
...
poetry/console/commands/install.py
View file @
5fc50555
import
os
from
cleo
import
option
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
InstallCommand
(
EnvCommand
):
class
InstallCommand
(
EnvCommand
):
"""
Installs the project dependencies.
name
=
"install"
description
=
"Installs the project dependencies."
install
{ --no-dev : Do not install dev dependencies. }
options
=
[
{ --no-root : Do not install the root package (your project). }
option
(
"no-dev"
,
None
,
"Do not install dev dependencies."
),
{ --dry-run : Outputs the operations but will not execute anything
option
(
(implicitly enables --verbose). }
"no-root"
,
None
,
"Do not install the root package (the current project)."
{ --E|extras=* : Extra sets of dependencies to install. }
),
{ --develop=* : Install given packages in development mode. }
option
(
"""
"dry-run"
,
None
,
"Outputs the operations but will not execute anything "
"(implicitly enables --verbose)."
,
),
option
(
"extras"
,
"E"
,
"Extra sets of dependencies to install."
,
flag
=
False
,
multiple
=
True
,
),
option
(
"develop"
,
None
,
"Install given packages in development mode."
,
flag
=
False
,
multiple
=
True
,
),
]
help
=
"""The <info>install</info> command reads the <comment>poetry.lock</> file from
help
=
"""The <info>install</info> command reads the <comment>poetry.lock</> file from
the current directory, processes it, and downloads and installs all the
the current directory, processes it, and downloads and installs all the
...
...
poetry/console/commands/lock.py
View file @
5fc50555
...
@@ -2,11 +2,9 @@ from .env_command import EnvCommand
...
@@ -2,11 +2,9 @@ from .env_command import EnvCommand
class
LockCommand
(
EnvCommand
):
class
LockCommand
(
EnvCommand
):
"""
Locks the project dependencies.
lock
name
=
"lock"
""
"
description
=
"Locks the project dependencies.
"
help
=
"""The <info>lock</info> command reads the <comment>pyproject.toml</> file from
help
=
"""The <info>lock</info> command reads the <comment>pyproject.toml</> file from
the current directory, processes it, and locks the depdencies in the <comment>poetry.lock</> file.
the current directory, processes it, and locks the depdencies in the <comment>poetry.lock</> file.
...
...
poetry/console/commands/new.py
View file @
5fc50555
from
cleo
import
argument
from
cleo
import
option
from
.command
import
Command
from
.command
import
Command
class
NewCommand
(
Command
):
class
NewCommand
(
Command
):
"""
Creates a new Python project at <path>
new
name
=
"new"
{ path : The path to create the project at. }
description
=
"Creates a new Python project at <path>"
{ --name= : Set the resulting package name. }
{ --src : Use the src layout for the project. }
arguments
=
[
argument
(
"path"
,
"The path to create the project at."
)]
"""
options
=
[
option
(
"name"
,
None
,
"Set the resulting package name."
,
flag
=
False
),
option
(
"src"
,
None
,
"Use the src layout for the project."
),
]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.layouts
import
layout
from
poetry.layouts
import
layout
...
...
poetry/console/commands/publish.py
View file @
5fc50555
from
cleo
import
option
from
.command
import
Command
from
.command
import
Command
class
PublishCommand
(
Command
):
class
PublishCommand
(
Command
):
"""
Publishes a package to a remote repository.
name
=
"publish"
description
=
"Publishes a package to a remote repository."
publish
{ --r|repository= : The repository to publish the package to. }
options
=
[
{ --u|username= : The username to access the repository. }
option
(
{ --p|password= : The password to access the repository. }
"repository"
,
"r"
,
"The repository to publish the package to."
,
flag
=
False
{ --build : Build the package before publishing. }
),
"""
option
(
"username"
,
"u"
,
"The username to access the repository."
,
flag
=
False
),
option
(
"password"
,
"p"
,
"The password to access the repository."
,
flag
=
False
),
option
(
"build"
,
None
,
"Build the package before publishing."
),
]
help
=
"""The publish command builds and uploads the package to a remote repository.
help
=
"""The publish command builds and uploads the package to a remote repository.
...
...
poetry/console/commands/remove.py
View file @
5fc50555
from
cleo
import
argument
from
cleo
import
option
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
RemoveCommand
(
EnvCommand
):
class
RemoveCommand
(
EnvCommand
):
"""
Removes a package from the project dependencies.
name
=
"remove"
description
=
"Removes a package from the project dependencies."
remove
{ packages* : Packages that should be removed. }
arguments
=
[
argument
(
"packages"
,
"Packages that should be removed"
,
multiple
=
True
)]
{--D|dev : Removes a package from the development dependencies. }
options
=
[
{--dry-run : Outputs the operations but will not execute anything
option
(
"dev"
,
"D"
,
"Removes a package from the development dependencies."
),
(implicitly enables --verbose). }
option
(
"""
"dry-run"
,
None
,
"Outputs the operations but will not execute anything "
"(implicitly enables --verbose)."
,
),
]
help
=
"""The <info>remove</info> command removes a package from the current
help
=
"""The <info>remove</info> command removes a package from the current
list of installed packages
list of installed packages
...
...
poetry/console/commands/run.py
View file @
5fc50555
from
cleo
import
argument
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
RunCommand
(
EnvCommand
):
class
RunCommand
(
EnvCommand
):
"""
Runs a command in the appropriate environment.
run
name
=
"run"
{ args* : The command and arguments/options to run. }
description
=
"Runs a command in the appropriate environment."
"""
arguments
=
[
argument
(
"args"
,
"The command and arguments/options to run."
,
multiple
=
True
)
]
def
__init__
(
self
):
# type: () -> None
def
__init__
(
self
):
# type: () -> None
from
poetry.console.args.run_args_parser
import
RunArgsParser
from
poetry.console.args.run_args_parser
import
RunArgsParser
...
...
poetry/console/commands/search.py
View file @
5fc50555
from
cleo
import
argument
from
cleo
import
option
from
.command
import
Command
from
.command
import
Command
class
SearchCommand
(
Command
):
class
SearchCommand
(
Command
):
"""
Searches for packages on remote repositories.
search
name
=
"search"
{ tokens* : The tokens to search for. }
description
=
"Searches for packages on remote repositories."
{ --N|only-name : Search only in name. }
"""
arguments
=
[
argument
(
"tokens"
,
"The tokens to search for."
,
multiple
=
True
)]
options
=
[
option
(
"only-name"
,
"N"
,
"Search only in name."
)]
def
handle
(
self
):
def
handle
(
self
):
from
poetry.repositories.pypi_repository
import
PyPiRepository
from
poetry.repositories.pypi_repository
import
PyPiRepository
...
...
poetry/console/commands/self/self.py
View file @
5fc50555
...
@@ -4,11 +4,9 @@ from .update import SelfUpdateCommand
...
@@ -4,11 +4,9 @@ from .update import SelfUpdateCommand
class
SelfCommand
(
Command
):
class
SelfCommand
(
Command
):
"""
Interact with Poetry directly.
"""
name
=
"self"
name
=
"self"
description
=
"Interact with Poetry directly."
commands
=
[
SelfUpdateCommand
()]
commands
=
[
SelfUpdateCommand
()]
...
...
poetry/console/commands/self/update.py
View file @
5fc50555
...
@@ -15,17 +15,19 @@ except ImportError:
...
@@ -15,17 +15,19 @@ except ImportError:
from
urllib2
import
HTTPError
from
urllib2
import
HTTPError
from
urllib2
import
urlopen
from
urllib2
import
urlopen
from
cleo
import
argument
from
cleo
import
option
from
..command
import
Command
from
..command
import
Command
class
SelfUpdateCommand
(
Command
):
class
SelfUpdateCommand
(
Command
):
"""
Updates poetry to the latest version.
update
name
=
"update"
{ version? : The version to update to. }
description
=
"Updates poetry to the latest version."
{ --preview : Install prereleases. }
"""
arguments
=
[
argument
(
"version"
,
"The version to update to."
,
optional
=
True
)]
options
=
[
option
(
"preview"
,
None
,
"Install prereleases."
)]
BASE_URL
=
"https://github.com/sdispater/poetry/releases/download"
BASE_URL
=
"https://github.com/sdispater/poetry/releases/download"
...
...
poetry/console/commands/shell.py
View file @
5fc50555
...
@@ -7,11 +7,9 @@ from .env_command import EnvCommand
...
@@ -7,11 +7,9 @@ from .env_command import EnvCommand
class
ShellCommand
(
EnvCommand
):
class
ShellCommand
(
EnvCommand
):
"""
Spawns a shell within the virtual environment.
shell [options]
name
=
"shell"
""
"
description
=
"Spawns a shell within the virtual environment.
"
help
=
"""The <info>shell</> command spawns a shell, according to the
help
=
"""The <info>shell</> command spawns a shell, according to the
<comment>$SHELL</> environment variable, within the virtual environment.
<comment>$SHELL</> environment variable, within the virtual environment.
...
...
poetry/console/commands/show.py
View file @
5fc50555
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
cleo
import
argument
from
cleo
import
option
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
ShowCommand
(
EnvCommand
):
class
ShowCommand
(
EnvCommand
):
"""
Shows information about packages.
name
=
"show"
description
=
"Shows information about packages."
show
{ package? : Package to inspect. }
arguments
=
[
argument
(
"package"
,
"Package to inspect"
,
optional
=
True
)]
{ --no-dev : Do not list the dev dependencies. }
options
=
[
{ --t|tree : List the dependencies as a tree. }
option
(
"no-dev"
,
None
,
"Do not list the dev dependencies."
),
{ --l|latest : Show the latest version. }
option
(
"tree"
,
"t"
,
"List the dependencies as a tree."
),
{ --o|outdated : Show the latest version
option
(
"latest"
,
"l"
,
"Show the latest version."
),
but only for packages that are outdated. }
option
(
{ --a|all : Show all packages (even those not compatible with current system). }
"outdated"
,
"""
"o"
,
"Show the latest version but only for packages that are outdated."
,
),
option
(
"all"
,
"a"
,
"Show all packages (even those not compatible with current system)."
,
),
]
help
=
"""The show command displays detailed information about a package, or
help
=
"""The show command displays detailed information about a package, or
lists all packages available."""
lists all packages available."""
...
...
poetry/console/commands/update.py
View file @
5fc50555
from
cleo
import
argument
from
cleo
import
option
from
.env_command
import
EnvCommand
from
.env_command
import
EnvCommand
class
UpdateCommand
(
EnvCommand
):
class
UpdateCommand
(
EnvCommand
):
"""
Update dependencies as according to the <comment>pyproject.toml</> file.
name
=
"update"
description
=
(
update
"Update dependencies as according to the <comment>pyproject.toml</> file."
{ packages?* : The packages to update. }
)
{ --no-dev : Do not install dev dependencies. }
{ --dry-run : Outputs the operations but will not execute anything
arguments
=
[
(implicitly enables --verbose). }
argument
(
"packages"
,
"The packages to update"
,
optional
=
True
,
multiple
=
True
)
{ --lock : Do not perform install (only update the lockfile). }
]
"""
options
=
[
option
(
"no-dev"
,
None
,
"Do not update dev dependencies."
),
option
(
"dry-run"
,
None
,
"Output the operations but do not execute anything "
"(implicitly enables --verbose)."
,
),
option
(
"lock"
,
None
,
"Do not perform operations (only update the lockfile)."
),
]
loggers
=
[
"poetry.repositories.pypi_repository"
]
loggers
=
[
"poetry.repositories.pypi_repository"
]
...
...
poetry/console/commands/version.py
View file @
5fc50555
from
cleo
import
argument
from
.command
import
Command
from
.command
import
Command
class
VersionCommand
(
Command
):
class
VersionCommand
(
Command
):
"""
Bumps the version of the project.
version
name
=
"version"
{ version=patch : The version number or the rule to update version }
description
=
"Bumps the version of the project."
"""
arguments
=
[
argument
(
"version"
,
"The version number or the rule to update the version."
,
optional
=
True
,
default
=
"patch"
,
)
]
help
=
"""
\
help
=
"""
\
The version command bumps the version of the project
The version command bumps the version of the project
...
...
pyproject.toml
View file @
5fc50555
...
@@ -23,7 +23,7 @@ classifiers = [
...
@@ -23,7 +23,7 @@ classifiers = [
# Requirements
# Requirements
[tool.poetry.dependencies]
[tool.poetry.dependencies]
python
=
"~2.7 || ^3.4"
python
=
"~2.7 || ^3.4"
cleo
=
"^0.7.
2
"
cleo
=
"^0.7.
4
"
requests
=
"^2.18"
requests
=
"^2.18"
cachy
=
"^0.2"
cachy
=
"^0.2"
requests-toolbelt
=
"^0.8.0"
requests-toolbelt
=
"^0.8.0"
...
...
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