Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python SDK: Add rr.version() #2084

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions rerun_py/rerun_sdk/rerun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ def init(
_spawn()


def version() -> str:
"""
Returns a verbose version string of the Rerun SDK.

Example: `rerun_py 0.6.0-alpha.0 [rustc 1.69.0 (84c898d65 2023-04-16), LLVM 15.0.7] aarch64-apple-darwin main bd8a072, built 2023-05-11T08:25:17Z`
""" # noqa: E501 line too long
return bindings.version() # type: ignore[no-any-return]


def is_enabled() -> bool:
"""
Is the Rerun SDK enabled.
Expand Down
7 changes: 7 additions & 0 deletions rerun_py/src/python_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fn rerun_bindings(_py: Python<'_>, m: &PyModule) -> PyResult<()> {

// init
m.add_function(wrap_pyfunction!(init, m)?)?;
m.add_function(wrap_pyfunction!(version, m)?)?;
m.add_function(wrap_pyfunction!(is_enabled, m)?)?;
m.add_function(wrap_pyfunction!(shutdown, m)?)?;

Expand Down Expand Up @@ -257,6 +258,12 @@ authkey = multiprocessing.current_process().authkey
authkey.as_bytes().to_vec()
}

/// Return a verbose version string
#[pyfunction]
fn version() -> String {
re_build_info::build_info!().to_string()
}

/// Is logging enabled in the global recording?
#[pyfunction]
fn is_enabled() -> bool {
Expand Down