Skip to content

Commit

Permalink
Bump metadata version to 2.4 to fix license bug (#2332)
Browse files Browse the repository at this point in the history
When a project sets `license = { file = "LICENSE" }`, we're currently
emitting a `License-File` entry, but Metadata-Version 2.3, which is
invalid and now gets rejected by PyPI, breaking publish for projects
using `license = { file = "LICENSE" }`. This change bumps the metadata
version.

Alternatively, we could only bump the version if license files are used
and use the old `License` field for `license = { file = "LICENSE" }`
again, but i'm not aware of any index currently rejecting metadata
version 2.4.
  • Loading branch information
konstin authored Nov 28, 2024
1 parent 57c74b6 commit 6090c81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["konstin <[email protected]>", "messense <[email protected]>"]
name = "maturin"
version = "1.7.6-beta.1"
version = "1.7.6"
description = "Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages"
exclude = [
"test-crates/**/*",
Expand Down
4 changes: 2 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Metadata23 {
/// Initializes with name, version and otherwise the defaults
pub fn new(name: String, version: Version) -> Self {
Self {
metadata_version: "2.3".to_string(),
metadata_version: "2.4".to_string(),
name,
version,
platform: vec![],
Expand Down Expand Up @@ -679,7 +679,7 @@ mod test {
);

let expected = expect![[r#"
Metadata-Version: 2.3
Metadata-Version: 2.4
Name: info-project
Version: 0.1.0
Summary: A test project
Expand Down

0 comments on commit 6090c81

Please sign in to comment.