Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locker: less verbose output for package.files in lock file 2.0 #6734

Merged

Conversation

radoering
Copy link
Member

Before #6393 (poetry 1.2 lockfile format) package files where reported in a separate section called metadata like that:

[metadata.files]
cffi = [
    {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"},
    {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"},
    {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"},
    {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"},
    ...
]
cryptography = [
    ...
]

With #6393 package files are reported in the concerning package section like that:

[[package]]
name = "cffi"
version = "1.15.1"
description = "Foreign Function Interface for Python calling C code."
category = "main"
optional = false
python-versions = "*"

[[package.files]]
file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl"
hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"

[[package.files]]
file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl"
hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"

[[package.files]]
file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl"
hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"

[[package.files]]
file = "cffi-1.15.1-cp27-cp27m-win32.whl"
hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"

...

That's a bit too verbose to my taste, escpecially if a package has many files. Just try adding cryptography as a dependency for example. (I shortened the output in this description.) With this PR the package section will look like this:

[[package]]
name = "cffi"
version = "1.15.1"
description = "Foreign Function Interface for Python calling C code."
category = "main"
optional = false
python-versions = "*"
files = [
    {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"},
    {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"},
    {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"},
    {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"},
    ...
]

In case anyone is wondering, the lines of code I changed in locker.py had no effect anymore because they prepared the metadata.files table which is not written anymore.

@neersighted neersighted changed the title locker: less verbose output for package.files in lockfile 2.0 locker: less verbose output for package.files in lock file 2.0 Oct 7, 2022
@neersighted
Copy link
Member

For those reading along at home: this is just alternate syntax/does not constitute a change in the lock file format.

@neersighted neersighted added this to the 1.3 milestone Oct 7, 2022
@neersighted neersighted added kind/refactor Pulls that refactor, or clean-up code area/deps Related to representing and locking dependencies labels Oct 7, 2022
@neersighted neersighted enabled auto-merge (rebase) October 7, 2022 17:26
@neersighted neersighted merged commit 0418424 into python-poetry:master Oct 7, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Oct 7, 2022

poetry.lock is machine-written and machine-read and caring about the formatting is pointless. cf #6562

@neersighted
Copy link
Member

I suppose that's fair, but if we can control the format used the more readable (for those of us who have to inspect lock files to debug Poetry) syntax might as well be used. I suspect this will look closer to what tomli_w writes, anyway.

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/deps Related to representing and locking dependencies kind/refactor Pulls that refactor, or clean-up code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants