hawdb 0.4.0

An embedded Rust graph database for local data-plane workloads
Documentation
module(
    name = "hawdb",
    version = "0.4.0",
)

bazel_dep(name = "rules_rust", version = "0.74.0")
bazel_dep(name = "rules_shell", version = "0.8.0")
bazel_dep(name = "rules_tla", version = "0.2.0")
bazel_dep(name = "bazel_skylib", version = "1.9.2")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_python", version = "2.3.4")

# Maintain the rules locally so the authoritative check also retains evidence.
local_path_override(
    module_name = "rules_tla",
    path = "third_party/rules_tla",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
    edition = "2024",
    versions = ["1.97.1"],
)
use_repo(rust, "rust_toolchains")

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
    name = "crate_index",
    cargo_lockfile = "//:Cargo.lock",
    manifests = ["//:Cargo.toml"],
)
use_repo(crate, "crate_index")

# The binding remains outside the library's Cargo workspace. Resolve only its
# PyO3 dependency here and reuse //:hawdb for the embedded engine itself.
crate.spec(
    features = [
        "abi3-py311",
        "extension-module",
    ],
    package = "pyo3",
    repositories = ["python_crates"],
    version = "0.29",
)
crate.from_specs(
    name = "python_crates",
    cargo_lockfile = "//bindings/python:Cargo.Bazel.lock",
)

_PYTHON_BUILD_ENV = {
    "PYO3_BUILD_EXTENSION_MODULE": "1",
    "PYO3_NO_PYTHON": "1",
}

crate.annotation(
    build_script_env = _PYTHON_BUILD_ENV,
    crate = "pyo3",
    repositories = ["python_crates"],
)
crate.annotation(
    build_script_env = _PYTHON_BUILD_ENV,
    crate = "pyo3-build-config",
    repositories = ["python_crates"],
)
crate.annotation(
    build_script_env = _PYTHON_BUILD_ENV,
    crate = "pyo3-ffi",
    repositories = ["python_crates"],
)
use_repo(crate, "python_crates")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.11")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "python_test_deps",
    python_version = "3.11",
    requirements_lock = "//bindings/python:requirements.txt",
)
use_repo(pip, "python_test_deps")