Skip to content

Parsing of Dynamic: field in PKG-INFO should be case insensitive #18667

@septatrix

Description

@septatrix

Summary

The matching of Dynamic fields in parse_pkg_info is case-sensitive. However, while debugging an unrelated issue I found PKG-INFO files which contained lines such as Dynamic: requires-python. This would not be detected by the current code and lead to false negatives.

for field in headers.get_all_values("Dynamic") {
match field.as_str() {
"Requires-Python" => return Err(MetadataError::DynamicField("Requires-Python")),
"Requires-Dist" => return Err(MetadataError::DynamicField("Requires-Dist")),
"Provides-Extra" => return Err(MetadataError::DynamicField("Provides-Extra")),
"Version" => dynamic = true,
_ => (),
}
}

Platform

Fedora 43

Version

uv 0.10.9

Python version

Python 3.14.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompatibilityCompatibility with a specification or another tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions