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
48ed586b
Unverified
Commit
48ed586b
authored
Oct 15, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make install installs the current project in editable mode
develop is now deprecated
parent
c2d9a6b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
35 deletions
+39
-35
CHANGELOG.md
+2
-0
poetry/console/commands/develop.py
+5
-34
poetry/console/commands/install.py
+32
-1
No files found.
CHANGELOG.md
View file @
48ed586b
...
...
@@ -15,6 +15,8 @@
-
Improved virtualenv detection and management.
-
Wildcard
`python`
dependencies are now equivalent to
`~2.7 || ^3.4`
.
-
Changed behavior of the resolver for conditional dependencies.
-
The
`install`
command will now install the current project in editable mode.
-
The
`develop`
command is now deprecated in favor of
`install`
.
-
Improved the
`check`
command.
### Fixed
...
...
poetry/console/commands/develop.py
View file @
48ed586b
import
os
from
.env_command
import
EnvCommand
class
DevelopCommand
(
EnvCommand
):
"""
Installs the current project in development mode.
Installs the current project in development mode.
(<error>Deprecated</error>)
develop
"""
help
=
"""
\
The <info>develop</
info> command installs the current project in development mode
.
The <info>develop</
> command is deprecated. Please use <info>install</info> instead
.
"""
def
handle
(
self
):
from
poetry.masonry.builders
import
SdistBuilder
from
poetry.io
import
NullIO
from
poetry.utils._compat
import
decode
from
poetry.utils.env
import
NullEnv
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
,
NullEnv
(),
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
(
"<warning>develop is deprecated use install instead.</warning>"
)
self
.
line
(
""
)
self
.
line
(
"Installing <info>{}</info> (<comment>{}</comment>)"
.
format
(
self
.
poetry
.
package
.
pretty_name
,
self
.
poetry
.
package
.
pretty_version
)
)
self
.
env
.
run
(
"pip"
,
"install"
,
"-e"
,
str
(
setup
.
parent
),
"--no-deps"
)
return
self
.
call
(
"install"
)
poetry/console/commands/install.py
View file @
48ed586b
import
os
from
.env_command
import
EnvCommand
...
...
@@ -25,6 +27,10 @@ exist it will look for <comment>pyproject.toml</> and do the same.
def
handle
(
self
):
from
poetry.installation
import
Installer
from
poetry.io
import
NullIO
from
poetry.masonry.builders
import
SdistBuilder
from
poetry.utils._compat
import
decode
from
poetry.utils.env
import
NullEnv
installer
=
Installer
(
self
.
output
,
...
...
@@ -47,4 +53,29 @@ exist it will look for <comment>pyproject.toml</> and do the same.
installer
.
dry_run
(
self
.
option
(
"dry-run"
))
installer
.
verbose
(
self
.
option
(
"verbose"
))
return
installer
.
run
()
return_code
=
installer
.
run
()
if
return_code
!=
0
:
return
return_code
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
,
NullEnv
(),
NullIO
())
with
setup
.
open
(
"w"
)
as
f
:
f
.
write
(
decode
(
builder
.
build_setup
()))
self
.
line
(
"Installing <info>{}</info> (<comment>{}</comment>)"
.
format
(
self
.
poetry
.
package
.
pretty_name
,
self
.
poetry
.
package
.
pretty_version
)
)
try
:
self
.
env
.
run
(
"pip"
,
"install"
,
"-e"
,
str
(
setup
.
parent
),
"--no-deps"
)
finally
:
if
not
has_setup
:
os
.
remove
(
str
(
setup
))
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