dv 0.0.0

Core Rust library for DimensionalVariable, a multi-language library for handling physical quantities with units.
Documentation
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test", "rust_doc")
load("@rules_python//python:defs.bzl", "py_binary")

package(default_visibility = ["//visibility:public"])

rust_library(
    name = "dv_rs",
    srcs = ["src/lib.rs", "src/units.rs"],
    compile_data = ["DOCS.md"],
    edition = "2024",
)

# Documentation target (equivalent to `cargo doc` for this crate)
rust_doc(
    name = "docs",
    crate = ":dv_rs",

)

# Simple Python HTTP server to serve the generated docs
py_binary(
    name = "serve_docs",
    srcs = ["serve_docs.py"],
    data = [":docs"],
)

rust_test(
    name = "unit_tests",
    srcs = [
        "src/lib.rs",
        "src/units.rs"
    ],
    deps = [":dv_rs"],
)

# --- Integration tests as separate crates ---
rust_test(
    name = "version_test",
    srcs = ["tests/version_test.rs"],
    deps = [":dv_rs"],
)

rust_test(
    name = "units_tests",
    srcs = ["tests/units_tests.rs"],
    deps = [":dv_rs"],
)

rust_test(
    name = "operator_tests",
    srcs = ["tests/operator_tests.rs"],
    deps = [":dv_rs"],
)

# Aggregate suite to match the original //core:integration_tests target name
test_suite(
    name = "integration_tests",
    tests = [
        ":version_test",
        ":units_tests",
        ":operator_tests",
    ],
)