mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
fix(templates): add C source files to Python sdist
This commit is contained in:
parent
d2193f4dba
commit
805a7cd0ae
|
|
@ -1220,7 +1220,15 @@ fn update_python_setup_py(path: &Path, language_name: &str, opts: &GenerateOpts)
|
|||
r#"startswith("cp"):"#,
|
||||
r#"startswith("cp") and not get_config_var("Py_GIL_DISABLED"):"#,
|
||||
);
|
||||
write_file(path, contents)?;
|
||||
write_file(path, &contents)?;
|
||||
}
|
||||
if !contents.contains("include(\"src/*.c\")") {
|
||||
info!("Updating sdist file list in setup.py");
|
||||
let contents = contents.replace(
|
||||
"include(\"src/tree_sitter/*.h\")",
|
||||
"include(\"src/tree_sitter/*.h\")\n self.filelist.include(\"src/*.c\")",
|
||||
);
|
||||
write_file(path, &contents)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ class EggInfo(egg_info):
|
|||
super().find_sources()
|
||||
self.filelist.recursive_include("queries", "*.scm")
|
||||
self.filelist.include("src/tree_sitter/*.h")
|
||||
self.filelist.include("src/*.c")
|
||||
|
||||
|
||||
setup(
|
||||
|
|
|
|||
Loading…
Reference in a new issue