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
2045fb41
Unverified
Commit
2045fb41
authored
May 24, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a develop command
parent
9b7e594d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
0 deletions
+53
-0
CHANGELOG.md
+1
-0
poetry/console/application.py
+2
-0
poetry/console/commands/__init__.py
+1
-0
poetry/console/commands/develop.py
+49
-0
No files found.
CHANGELOG.md
View file @
2045fb41
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
-
Added the
`--python`
option to the
`add`
command.
-
Added the
`--python`
option to the
`add`
command.
-
Added the
`--platform`
option to the
`add`
command.
-
Added the
`--platform`
option to the
`add`
command.
-
Added a
`--develop`
option to the install command to install path dependencies in development/editable mode.
-
Added a
`--develop`
option to the install command to install path dependencies in development/editable mode.
-
Added a
`develop`
command to install the current project in development mode.
### Changed
### Changed
...
...
poetry/console/application.py
View file @
2045fb41
...
@@ -18,6 +18,7 @@ from .commands import AddCommand
...
@@ -18,6 +18,7 @@ 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
InitCommand
from
.commands
import
InitCommand
from
.commands
import
InstallCommand
from
.commands
import
InstallCommand
from
.commands
import
LockCommand
from
.commands
import
LockCommand
...
@@ -107,6 +108,7 @@ class Application(BaseApplication):
...
@@ -107,6 +108,7 @@ class Application(BaseApplication):
BuildCommand
(),
BuildCommand
(),
CheckCommand
(),
CheckCommand
(),
ConfigCommand
(),
ConfigCommand
(),
DevelopCommand
(),
InitCommand
(),
InitCommand
(),
InstallCommand
(),
InstallCommand
(),
LockCommand
(),
LockCommand
(),
...
...
poetry/console/commands/__init__.py
View file @
2045fb41
...
@@ -3,6 +3,7 @@ from .add import AddCommand
...
@@ -3,6 +3,7 @@ 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
.init
import
InitCommand
from
.init
import
InitCommand
from
.install
import
InstallCommand
from
.install
import
InstallCommand
from
.lock
import
LockCommand
from
.lock
import
LockCommand
...
...
poetry/console/commands/develop.py
0 → 100644
View file @
2045fb41
import
os
from
.venv_command
import
VenvCommand
class
DevelopCommand
(
VenvCommand
):
"""
Installs the current project in development mode.
develop
"""
help
=
"""
\
The <info>develop</info> command installs the current project in development mode.
"""
def
handle
(
self
):
from
poetry.masonry.builders
import
SdistBuilder
from
poetry.io
import
NullIO
from
poetry.utils._compat
import
decode
from
poetry.utils.venv
import
NullVenv
setup
=
self
.
poetry
.
file
.
parent
/
'setup.py'
has_setup
=
setup
.
exists
()
if
has_setup
:
self
.
line
(
'<warning>A setup.py file already exists. Using it.</warning>'
)
else
:
builder
=
SdistBuilder
(
self
.
poetry
,
NullVenv
(),
NullIO
())
with
setup
.
open
(
'w'
)
as
f
:
f
.
write
(
decode
(
builder
.
build_setup
()))
try
:
self
.
_install
(
setup
)
finally
:
if
not
has_setup
:
os
.
remove
(
str
(
setup
))
def
_install
(
self
,
setup
):
self
.
call
(
'install'
)
self
.
line
(
'Installing <info>{}</info> (<comment>{}</comment>)'
.
format
(
self
.
poetry
.
package
.
pretty_name
,
self
.
poetry
.
package
.
pretty_version
)
)
self
.
venv
.
run
(
'pip'
,
'install'
,
'-e'
,
str
(
setup
.
parent
),
'--no-deps'
)
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