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

New Metadata Version on ruff-0.8.1-py3-none-linux_armv6l.whl #14681

Closed
matthewakram opened this issue Nov 29, 2024 · 11 comments
Closed

New Metadata Version on ruff-0.8.1-py3-none-linux_armv6l.whl #14681

matthewakram opened this issue Nov 29, 2024 · 11 comments

Comments

@matthewakram
Copy link

It seems that there is an issue with latest wheel. The metadata version on is at 2.4. The pkginfo package support only metadata versions up to 2.3. This is pretty important since this is a crucial part of how Poetry resolved the package to install. Would it be possible to roll that back, ensuring that none of the released wheels have metadata version >2.3? I am not sure what the metadata versions of all the other wheels are, but I am getting the error for ruff-0.8.1-py3-none-linux_armv6l.whl.

here is the exact error:

C:\Users\\...\.venv\Lib\\site-packages\pkginfo\\distribution.py:175: NewMetadataVersion: New metadata version (2.4) higher than latest supported version: parsing as 2.3
  warnings.warn(NewMetadataVersion(self.metadata_version))

Unable to determine package info for path: C:\Users\...\AppData\Local\Temp\2\tmpivaox21p\ruff-0.8.1-py3-none-linux_armv6l.whl

Unknown metadata version: 2.4

Steps to recreate.

  1. windows machine
  2. start a poetry project
  3. add ruff = "0.8.1" to the dependencies
  4. run poetry update
@MichaReiser
Copy link
Member

What version of poetry are you using? I just tried installing Ruff with Poetry 1.8.4 and it was successful:

❯ uvx poetry add ruff --python 3.10
Using version ^0.8.1 for ruff

Updating dependencies
Resolving dependencies... (0.1s)

Package operations: 1 install, 0 updates, 0 removals

  - Installing ruff (0.8.1)

Writing lock file

@dmcauslan
Copy link

Maybe it depends on how poetry is installed? I'm seeing the same issue with poetry 1.8.4 installed via pipx.

@MichaReiser
Copy link
Member

Maybe it depends on how poetry is installed? I'm seeing the same issue with poetry 1.8.4 installed via pipx.

I hope not. That would be rather surprising. Can you share what platform your on and run poetry --version? I now verified that adding ruff works on macos and windows.

@mohsen-eng74
Copy link

mohsen-eng74 commented Nov 30, 2024

I have the same issue:

OS: Ubuntu 22.04.5 LTS 64-bit
Poetry: 1.8.4 (Installed via vendor-specific installation script)
Python: 3.12.7 (Installed via `pyenv 2.4.19-2-g61406193`)
Downloading ...pypi/packages/packages/a2/d6/1a6314e568db88acdbb5121ed53e2c52cebf3720d3437a76f82f923bf171/ruff-0.8.1-py3-none-linux_armv6l.whl#sha256=fae0805bd514066f20309f6742f6ee7904a773eb9e6c17c45d6b1600ca65c9b5  96% (14.7s).../.local/share/pypoetry/venv/lib/python3.12/site-packages/pkginfo/distribution.py:175: NewMetadataVersion: New metadata version (2.4) higher than latest supported version: parsing as 2.3
  warnings.warn(NewMetadataVersion(self.metadata_version))

Unable to determine package info for path: /tmp/tmpv0nhj4py/ruff-0.8.1-py3-none-linux_armv6l.whl

Unknown metadata version: 2.4

@MichaReiser
Copy link
Member

I suggest reporting this to poetry because downgrading the metadata version is not in our control (managed by maturin)

@MichaReiser
Copy link
Member

To give some more context on why we bumped the metadata version.

We tried publishing Ruff 0.8 with the old metadata version but pypi rejected the wheel (unlike previous releases where this just worked)

error: Failed to publish `wheels/ruff-0.8.1-py3-none-linux_armv6l.whl` to https://upload.pypi.org/legacy/
  Caused by: Upload failed with status code 400 Bad Request. Server says: 400 license-file introduced in metadata version 2.4, not 2.3. See https://packaging.python.org/specifications/core-metadata for more information.

That's why I don't think we can do anything at our end.

@bigpick
Copy link

bigpick commented Dec 2, 2024

I hope not. That would be rather surprising. Can you share what platform your on and run poetry --version? I now verified that adding ruff works on macos and windows.

FWIW, I'm seeing this on macOS, with poetry (installed via pip install) 1.8.4 and Python 3.11.10) on our existing projects


Though, in a completely fresh environment...

mkdir /tmp/test_ruff_poetry

cd /tmp/test_ruff_poetry

mkdir -p src/test

touch src/test/__init__.py

python3.11 -m venv .venv

source .venv/bin/activate

python --version
# Python 3.11.10

pip install poetry

which poetry
# <in the venv in curr dir>

poetry --version
# Poetry (version 1.8.4)

cat << EOF > pyproject.toml
[tool.poetry]
name="test"
authors=[]
version="0.0.0"
description=""
packages=[
   { include = "test", from="src"}
]

[tool.poetry.dependencies]
python = ">=3.11,<4"
ruff = "0.8.1"
EOF 

poetry install

works.


Of note: We usually pull our deps through an internal Artifactory; the above (without the artifactory source) works, but keeping the same thing but attempting to use the internal repository encounters the error

[[tool.poetry.source]]
name = "Private Internal Artifactory Source"
url =  "..."
priority = "primary"

@bigpick
Copy link

bigpick commented Dec 2, 2024

I suggest reporting this to poetry ...

Related to this: python-poetry/poetry#9670

@MichaReiser
Copy link
Member

MichaReiser commented Dec 2, 2024

Could you try updating the pkginfo dependency. The newest released version (which poetry uses) adds support for 2.4. This also explains why running poetry with uvx works because it installs the latest pkginfo version but might not work in your project where you use an older verison.

https://pypi.org/project/pkginfo/

@MichaReiser MichaReiser removed the needs-mre Needs more information for reproduction label Dec 2, 2024
@bigpick
Copy link

bigpick commented Dec 2, 2024

The newest released version (which poetry uses) adds support for 2.4. This also explains why running poetry with uvx works because it installs the latest pkginfo version but might not work in your project where you use an older verison.

Trying the above again, looks like it does get the newest pkginfo version (1.12.0, that was released 12 minutes ago) and works for me for both the public and Artifactory example

@MichaReiser
Copy link
Member

I'll close this because there's now a known fix on the poetry side (upgrade pkginfo). Let me know if it doesn't resolve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants