Skip to content

Commit

Permalink
Revert "Revert to 0.x versioning in pyproject.toml"
Browse files Browse the repository at this point in the history
This reverts commit 28cd313.
  • Loading branch information
messense committed May 23, 2023
1 parent c2c9e70 commit 35471b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/pyproject_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
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 }}.{{ version_minor + 1 }}"]
requires = ["maturin>={{ version_major }}.{{ version_minor }},<{{ version_major + 1 }}.0"]
build-backend = "maturin"

[project]
Expand Down

0 comments on commit 35471b9

Please sign in to comment.