[package]
name = "safetensors-python"
version = "0.8.0"
edition = "2021"
rust-version = "1.74"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "safetensors_rust"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.28", features = ["abi3", "abi3-py310"] }
memmap2 = "0.9"
serde_json = "1.0"

[dependencies.safetensors]
path = "../../safetensors"

[target.'cfg(target_os = "macos")'.dependencies]
libc = "0.2"

# Metal-direct MTLBuffer path is Apple-silicon-only: Shared-mode buffers rely
# on UMA semantics that don't hold on Intel Macs with discrete GPUs. Intel
# Macs fall back to the existing copy path.
[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies]
objc2 = "0.6"
objc2-metal = { version = "0.3", features = [
  "MTLDevice",
  "MTLBuffer",
  "MTLResource",
] }
