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

fix: workaround unsupported metadata version 2.4 in pkginfo #9881

Merged

Conversation

finswimmer
Copy link
Member

@finswimmer finswimmer commented Dec 2, 2024

pkginfo will show a warning if it detects metadata version:

NewMetadataVersion: New metadata version (2.4) higher than latest supported version: parsing as 2.3
  warnings.warn(NewMetadataVersion(self.metadata_version))

I decided to not suppress this message.

Related to #9670 (comment)

@finswimmer finswimmer force-pushed the workaround-metadata-version branch from 340ca21 to 7fe24cd Compare December 2, 2024 11:44
@finswimmer finswimmer force-pushed the workaround-metadata-version branch from 7fe24cd to a3c16f2 Compare December 2, 2024 15:26
@finswimmer finswimmer marked this pull request as ready for review December 2, 2024 15:34
@finswimmer finswimmer requested a review from a team December 2, 2024 15:34
@radoering radoering added the backport/1.8 Backport a PR to 1.8 through an automated PR label Dec 2, 2024
@radoering radoering enabled auto-merge (squash) December 2, 2024 17:43
@radoering radoering merged commit 9e2a8bd into python-poetry:main Dec 2, 2024
73 checks passed
@poetry-bot
Copy link

poetry-bot bot commented Dec 2, 2024

The backport to 1.8 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.8 1.8
# Navigate to the new working tree
cd .worktrees/backport-1.8
# Create a new branch
git switch --create backport-9881-to-1.8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9e2a8bd5ff6de05d9af03fbefce647b673b13352
# Push it to GitHub
git push --set-upstream origin backport-9881-to-1.8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.8

Then, create a pull request where the base branch is 1.8 and the compare/head branch is backport-9881-to-1.8.

Copy link

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix might no longer be required. A new pkginfo version was released just a few minutes ago that adds support for 2.4.

What would be nice in general is if poetry wouldn't fail when seeing a newer minor version and instead just warns about it.

@dimbleby
Copy link
Contributor

dimbleby commented Dec 2, 2024

poetry wouldn't fail when seeing a newer minor version and instead just warns about it.

that already is the behaviour, since pkginfo 1.11.0

@radoering radoering removed the backport/1.8 Backport a PR to 1.8 through an automated PR label Dec 2, 2024
@radoering
Copy link
Member

This fix might no longer be required. A new pkginfo version was released just a few minutes ago that adds support for 2.4.

Thanks for the info.

What would be nice in general is if poetry wouldn't fail when seeing a newer minor version and instead just warns about it.

Poetry did not fail before #9203. However, this resulted in #9195, which is worse than failing. It seems like pkginfo handles unknown METADATA versions better now so maybe we can (partially) revert #9203.

@dimbleby
Copy link
Contributor

dimbleby commented Dec 2, 2024

poetry only fails on unexpected metadata versions in some of the code paths, which I think adds to the general confusion (including my own)

eg so far as I can see the _get_info_from_metadata() path does not care about metadata version.

Probably this is why some people saw a problem and some did not - they either were or were not using pypi / a private repository.

@broodjeaap
Copy link

For anyone looking for a quick fix, you can downgrade poetry with:
poetry self update 1.8.2

@dimbleby
Copy link
Contributor

dimbleby commented Dec 5, 2024

it's upgrading pkginfo that helps, not downgrading poetry

@Buedenbender
Copy link

In my case it was resolved by

pip install --upgrade pkginfo
pip install --upgrade poetry
pip install --upgrade pip

Aftwards i was able to successfully install ruff in my poetry env via
poetry add -G dev ruff

@python-poetry python-poetry locked as resolved and limited conversation to collaborators Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants