feat(bindings): drop python 3.9 support

This commit is contained in:
ObserverOfTime 2024-10-17 17:00:43 +03:00 committed by Amaan Qureshi
parent 29e6717c31
commit 7bf51ae08a
3 changed files with 16 additions and 14 deletions

View file

@ -515,14 +515,24 @@ pub fn generate_grammar_files(
},
)?;
missing_path(repo_path.join("pyproject.toml"), |path| {
missing_path_else(repo_path.join("pyproject.toml"), allow_update, |path| {
generate_file(
path,
PYPROJECT_TOML_TEMPLATE,
dashed_language_name.as_str(),
&generate_opts,
)
})?;
}, |path| {
let mut contents = fs::read_to_string(path)?;
if !contents.contains("cp310-*") {
contents = contents
.replace(r#"build = "cp39-*""#, r#"build = "cp310-*""#)
.replace(r#"python = ">=3.9""#, r#"python = ">=3.10""#)
.replace("tree-sitter~=0.22", "tree-sitter~=0.24");
write_file(path, contents)?;
}
Ok(())
})?;
Ok(())
})?;
@ -705,11 +715,7 @@ fn generate_file(
.map(|i| i + start_idx + 2)
{
replacement.replace_range(start_idx..end_idx, "");
} else {
println!("none 2");
}
} else {
println!("none 1");
}
}
"grammar.js" => {
@ -719,11 +725,7 @@ fn generate_file(
.map(|i| i + start_idx + 1)
{
replacement.replace_range(start_idx..end_idx, "");
} else {
println!("none 2");
}
} else {
println!("none 1");
}
}
"Cargo.toml" => {

View file

@ -14,7 +14,7 @@ classifiers = [
"Typing :: Typed",
]
authors = [{ name = "PARSER_AUTHOR_NAME", email = "PARSER_AUTHOR_EMAIL" }]
requires-python = ">=3.9"
requires-python = ">=3.10"
license.text = "PARSER_LICENSE"
readme = "README.md"
@ -22,8 +22,8 @@ readme = "README.md"
Homepage = "PARSER_URL"
[project.optional-dependencies]
core = ["tree-sitter~=0.22"]
core = ["tree-sitter~=0.24"]
[tool.cibuildwheel]
build = "cp39-*"
build = "cp310-*"
build-frontend = "build"

View file

@ -31,7 +31,7 @@ class BdistWheel(bdist_wheel):
def get_tag(self):
python, abi, platform = super().get_tag()
if python.startswith("cp"):
python, abi = "cp39", "abi3"
python, abi = "cp310", "abi3"
return python, abi, platform