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
0222bf6b
Unverified
Commit
0222bf6b
authored
Feb 28, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid unnecessary operations when using lock
parent
271e9958
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
+26
-9
poetry/console/commands/lock.py
+1
-2
poetry/installation/installer.py
+25
-7
No files found.
poetry/console/commands/lock.py
View file @
0222bf6b
...
...
@@ -27,7 +27,6 @@ the current directory, processes it, and locks the depdencies in the <comment>po
self
.
poetry
.
pool
,
)
installer
.
update
(
True
)
installer
.
execute_operations
(
False
)
installer
.
lock
()
return
installer
.
run
()
poetry/installation/installer.py
View file @
0222bf6b
...
...
@@ -47,6 +47,7 @@ class Installer:
self
.
_dev_mode
=
True
self
.
_develop
=
[]
self
.
_execute_operations
=
True
self
.
_lock
=
False
self
.
_whitelist
=
[]
...
...
@@ -111,6 +112,16 @@ class Installer:
return
self
def
lock
(
self
):
# type: () -> Installer
"""
Prepare the installer for locking only.
"""
self
.
update
()
self
.
execute_operations
(
False
)
self
.
_lock
=
True
return
self
def
is_updating
(
self
):
# type: () -> bool
return
self
.
_update
...
...
@@ -182,6 +193,12 @@ class Installer:
self
.
_populate_local_repo
(
local_repo
,
ops
,
locked_repository
)
if
self
.
_lock
:
# If we are only in lock mode, no need to go any further
self
.
_write_lock_file
(
local_repo
)
return
0
root
=
self
.
_package
if
not
self
.
is_dev_mode
():
root
=
root
.
clone
()
...
...
@@ -273,19 +290,20 @@ class Installer:
)
# Writing lock before installing
self
.
_write_lock_file
(
local_repo
)
self
.
_io
.
writeln
(
""
)
for
op
in
ops
:
self
.
_execute
(
op
)
def
_write_lock_file
(
self
,
repo
):
# type: (Repository) -> None
if
self
.
_update
and
self
.
_write_lock
:
updated_lock
=
self
.
_locker
.
set_lock_data
(
self
.
_package
,
local_repo
.
packages
)
updated_lock
=
self
.
_locker
.
set_lock_data
(
self
.
_package
,
repo
.
packages
)
if
updated_lock
:
self
.
_io
.
writeln
(
""
)
self
.
_io
.
writeln
(
"<info>Writing lock file</>"
)
self
.
_io
.
writeln
(
""
)
for
op
in
ops
:
self
.
_execute
(
op
)
def
_execute
(
self
,
operation
):
# type: (Operation) -> None
"""
Execute a given operation.
...
...
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