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
a7ffb9dd
Unverified
Commit
a7ffb9dd
authored
May 19, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix update command without whitelisted packages
parent
b283ca8d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
1 deletions
+59
-1
poetry/installation/installer.py
+8
-1
tests/installation/fixtures/update-with-lock.test
+16
-0
tests/installation/test_installer.py
+35
-0
No files found.
poetry/installation/installer.py
View file @
a7ffb9dd
...
...
@@ -125,7 +125,14 @@ class Installer:
def
_do_install
(
self
,
local_repo
):
locked_repository
=
Repository
()
if
self
.
_update
:
if
self
.
_locker
.
is_locked
():
if
self
.
_locker
.
is_locked
()
and
self
.
_whitelist
:
# If we update with a lock file present and
# we have whitelisted packages (the ones we want to update)
# we get the lock file packages to only update
# what is strictly needed.
#
# Otherwise, the lock file information is irrelevant
# since we want to update everything.
locked_repository
=
self
.
_locker
.
locked_repository
(
True
)
# Checking extras
...
...
tests/installation/fixtures/update-with-lock.test
0 → 100644
View file @
a7ffb9dd
[[
package
]]
name
=
"A"
version
=
"1.1"
description
=
""
category
=
"main"
optional
=
false
python
-
versions
=
"*"
platform
=
"*"
[
metadata
]
python
-
versions
=
"*"
platform
=
"*"
content
-
hash
=
"123456789"
[
metadata
.
hashes
]
"A"
=
[]
tests/installation/test_installer.py
View file @
a7ffb9dd
...
...
@@ -650,3 +650,38 @@ def test_run_changes_category_if_needed(installer, locker, repo, package):
expected
=
fixture
(
'with-category-change'
)
assert
locker
.
written_data
==
expected
def
test_run_update_all_with_lock
(
installer
,
locker
,
repo
,
package
):
locker
.
locked
(
True
)
locker
.
mock_lock_data
({
'package'
:
[{
'name'
:
'A'
,
'version'
:
'1.0'
,
'category'
:
'dev'
,
'optional'
:
True
,
'platform'
:
'*'
,
'python-versions'
:
'*'
,
'checksum'
:
[]
}],
'metadata'
:
{
'python-versions'
:
'*'
,
'platform'
:
'*'
,
'content-hash'
:
'123456789'
,
'hashes'
:
{
'A'
:
[],
}
}
})
package_a
=
get_package
(
'A'
,
'1.1'
)
repo
.
add_package
(
get_package
(
'A'
,
'1.0'
))
repo
.
add_package
(
package_a
)
package
.
add_dependency
(
'A'
)
installer
.
update
(
True
)
installer
.
run
()
expected
=
fixture
(
'update-with-lock'
)
assert
locker
.
written_data
==
expected
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