Skip to content

Commit

Permalink
Revert to 0.x versioning in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed May 7, 2023
1 parent 5c774f0 commit 28cd313
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/pyproject_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/pyproject.toml.j2
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 28cd313

Please sign in to comment.