From 28cd313a3a7c299b5828a633ed864e0274ae022c Mon Sep 17 00:00:00 2001 From: messense Date: Sun, 7 May 2023 14:00:41 +0800 Subject: [PATCH] Revert to 0.x versioning in pyproject.toml --- src/pyproject_toml.rs | 10 ++++++---- src/templates/pyproject.toml.j2 | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pyproject_toml.rs b/src/pyproject_toml.rs index a2afb1c63..57cd1351e 100644 --- a/src/pyproject_toml.rs +++ b/src/pyproject_toml.rs @@ -313,15 +313,17 @@ impl PyProjectToml { .iter() .find(|x| x.name == maturin) { - let current_major: usize = env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(); + // 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(); if requires_maturin.version_or_url.is_none() { eprintln!( "⚠️ Warning: Please use {maturin} in pyproject.toml with a version constraint, \ - e.g. `requires = [\"{maturin}>={current}.0,<{next}.0\"]`. \ + e.g. `requires = [\"{maturin}>=0.{current},<0.{next}\"]`. \ This will become an error.", maturin = maturin, - current = current_major, - next = current_major + 1, + current = current_minor, + next = current_minor + 1, ); return false; } diff --git a/src/templates/pyproject.toml.j2 b/src/templates/pyproject.toml.j2 index ae5e60f10..412cb537e 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 + 1 }}.0"] +requires = ["maturin>={{ version_major }}.{{ version_minor }},<{{ version_major }}.{{ version_minor + 1 }}"] build-backend = "maturin" [project]