open-telemetry / open-telemetry/opentelemetry-python-contrib

Invalid wheel metadata in opentelemetry-resource-detector-azure 0.1.5 (Metadata-Version 2.3 with PEP 639 fields)

Open
#4,945 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Describe your environment

OS: Linux
Python version: Python 3.13.11
Package version: opentelemetry-resource-detector-azure 0.1.5

twine==7.0.0
pkginfo==1.12.1.2
packaging==26.2

What happened?

We're encountering an issue when mirroring opentelemetry-resource-detector-azure==0.1.5 into a private Python package repository.

The package is rejected by Twine validation with the following error:

The failure is caused by invalid wheel metadata published by opentelemetry-resource-detector-azure. All tested versions (0.1.0-0.1.5) declare Metadata-Version: 2.3 while containing the PEP 639 fields License-Expression and License-File, which require Metadata 2.4. Twine validation rejects the wheel before upload with InvalidDistribution: license-expression introduced in metadata version 2.4, not 2.3. The issue reproduces locally using the latest Twine (7.0.0), pkginfo (1.12.1.2), and packaging (26.2), confirming that the package metadata itself is incompatible with Twine validation.

The package can be downloaded directly from PyPI, but any repository or mirroring pipeline that validates package metadata using current tooling fails to ingest the artifact, making downstream installation impossible from validated private indexes.

Steps to Reproduce

After downloading the wheel from PyPI:

pip download opentelemetry-resource-detector-azure==0.1.5

the wheel's METADATA file contains (first lines only):

Metadata-Version: 2.3
Name: opentelemetry-resource-detector-azure
Version: 0.1.5
Summary: Azure Resource Detector for OpenTelemetry
Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/resource/opentelemetry-res…
Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
...
Expected Result

Metadata-Version is updated to 2.4, or the metadata fields are generated consistently with the declared version

Actual Result

The metadata declares: Metadata-Version: 2.3 also introduces: License-Expression and License-File which are PEP 639 fields introduced in Metadata 2.4.

As a result, current packaging validation tools reject the distribution before upload to private repositories.

Additional context

Generated SHA from the downloaded opentelemetry_resource_detector_azure-0.1.5-py3-none-any.whl
4dcc5d54ab5c3b11226af39509bc98979a8b9e0f8a24c1b888783755d3bf00eb

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running pip download opentelemetry-resource-detector-azure==0.1.5 and inspect the wheel's METADATA file, checking its declared version against the License-Expression and License-File fields. Trace how the package metadata is generated, then verify that a rebuilt distribution passes current Twine validation with consistent metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.