From 35471b92b23919e63820c3a2e794446e221b7688 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 23 May 2023 11:10:43 +0000 Subject: [PATCH] Revert "Revert to 0.x versioning in pyproject.toml" This reverts commit 28cd313a3a7c299b5828a633ed864e0274ae022c. --- src/pyproject_toml.rs | 10 ++++------ src/templates/pyproject.toml.j2 | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pyproject_toml.rs b/src/pyproject_toml.rs index 394b86d71..b8e50c62a 100644 --- a/src/pyproject_toml.rs +++ b/src/pyproject_toml.rs @@ -311,17 +311,15 @@ impl PyProjectToml { .iter() .find(|x| x.name == maturin) { - // Note: Update this once 1.0 is out - assert_eq!(env!("CARGO_PKG_VERSION_MAJOR"), "0"); - let current_minor: usize = env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(); + let current_major: usize = env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(); if requires_maturin.version_or_url.is_none() { eprintln!( "⚠️ Warning: Please use {maturin} in pyproject.toml with a version constraint, \ - e.g. `requires = [\"{maturin}>=0.{current},<0.{next}\"]`. \ + e.g. `requires = [\"{maturin}>={current}.0,<{next}.0\"]`. \ This will become an error.", maturin = maturin, - current = current_minor, - next = current_minor + 1, + current = current_major, + next = current_major + 1, ); return false; } diff --git a/src/templates/pyproject.toml.j2 b/src/templates/pyproject.toml.j2 index 412cb537e..ae5e60f10 100644 --- a/src/templates/pyproject.toml.j2 +++ b/src/templates/pyproject.toml.j2 @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>={{ version_major }}.{{ version_minor }},<{{ version_major }}.{{ version_minor + 1 }}"] +requires = ["maturin>={{ version_major }}.{{ version_minor }},<{{ version_major + 1 }}.0"] build-backend = "maturin" [project]