mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-08 20:02:42 -04:00
Add a stub Rust crate (#12595)
This commit is contained in:
parent
3d20115115
commit
c9b7e97355
23 changed files with 302 additions and 11 deletions
20
build_rust.py
Normal file
20
build_rust.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# A build script for poetry that adds the rust extension.
|
||||
|
||||
import os
|
||||
from typing import Any, Dict
|
||||
|
||||
from setuptools_rust import Binding, RustExtension
|
||||
|
||||
|
||||
def build(setup_kwargs: Dict[str, Any]) -> None:
|
||||
original_project_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
cargo_toml_path = os.path.join(original_project_dir, "rust", "Cargo.toml")
|
||||
|
||||
extension = RustExtension(
|
||||
target="synapse.synapse_rust",
|
||||
path=cargo_toml_path,
|
||||
binding=Binding.PyO3,
|
||||
py_limited_api=True,
|
||||
)
|
||||
setup_kwargs.setdefault("rust_extensions", []).append(extension)
|
||||
setup_kwargs["zip_safe"] = False
|
Loading…
Add table
Add a link
Reference in a new issue