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
04184247
Commit
04184247
authored
Oct 07, 2022
by
Randy Döring
Committed by
Bjorn Neergaard
Oct 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locker: less verbose output for `package.files` in lockfile 2.0
parent
4578c6f4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
22 deletions
+10
-22
src/poetry/packages/locker.py
+3
-10
tests/packages/test_locker.py
+7
-12
No files found.
src/poetry/packages/locker.py
View file @
04184247
...
...
@@ -23,10 +23,8 @@ from tomlkit import array
from
tomlkit
import
comment
from
tomlkit
import
document
from
tomlkit
import
inline_table
from
tomlkit
import
item
from
tomlkit
import
table
from
tomlkit.exceptions
import
TOMLKitError
from
tomlkit.items
import
Array
if
TYPE_CHECKING
:
...
...
@@ -228,24 +226,19 @@ class Locker:
return
repository
def
set_lock_data
(
self
,
root
:
Package
,
packages
:
list
[
Package
])
->
bool
:
files
:
dict
[
str
,
Any
]
=
table
()
package_specs
=
self
.
_lock_packages
(
packages
)
# Retrieving hashes
for
package
in
package_specs
:
if
package
[
"name"
]
not
in
files
:
files
[
package
[
"name"
]]
=
[]
files
=
array
()
for
f
in
package
[
"files"
]:
file_metadata
=
inline_table
()
for
k
,
v
in
sorted
(
f
.
items
()):
file_metadata
[
k
]
=
v
files
[
package
[
"name"
]]
.
append
(
file_metadata
)
files
.
append
(
file_metadata
)
if
files
[
package
[
"name"
]]:
package_files
=
item
(
files
[
package
[
"name"
]])
assert
isinstance
(
package_files
,
Array
)
files
[
package
[
"name"
]]
=
package_files
.
multiline
(
True
)
package
[
"files"
]
=
files
.
multiline
(
True
)
lock
=
document
()
lock
.
add
(
comment
(
GENERATED_COMMENT
))
...
...
tests/packages/test_locker.py
View file @
04184247
...
...
@@ -104,14 +104,10 @@ description = ""
category = "main"
optional = false
python-versions = "*"
[[package.files]]
file = "bar"
hash = "123"
[[package.files]]
file = "foo"
hash = "456"
files = [
{{file = "bar", hash = "123"}},
{{file = "foo", hash = "456"}},
]
[package.dependencies]
B = "^1.0"
...
...
@@ -123,10 +119,9 @@ description = ""
category = "main"
optional = false
python-versions = "*"
[[package.files]]
file = "baz"
hash = "345"
files = [
{{file = "baz", hash = "345"}},
]
[[package]]
name = "B"
...
...
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