Skip to content

Commit

Permalink
Add __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Jan 1, 2024
1 parent 816a1a7 commit a587044
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rlviser-py"
version = "0.6.2"
version = "0.6.3"
edition = "2021"
description = "Python implementation that manages a UDP connection to RLViser"
license = "MIT"
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ use core::cell::RefCell;
use pyo3::prelude::*;

macro_rules! pynamedmodule {
(doc: $doc:literal, name: $name:tt, funcs: [$($func_name:path),*]) => {
(doc: $doc:literal, name: $name:tt, funcs: [$($func_name:path),*], vars: [$(($var_name:literal, $value:expr)),*]) => {
#[doc = $doc]
#[pymodule]
#[allow(redundant_semicolons)]
fn $name(_py: Python, m: &PyModule) -> PyResult<()> {
$(m.add_function(wrap_pyfunction!($func_name, m)?)?);*;
$(m.add($var_name, $value)?);*;
Ok(())
}
};
Expand All @@ -30,6 +31,9 @@ pynamedmodule! {
get_state_set,
render,
quit
],
vars: [
("__version__", env!("CARGO_PKG_VERSION"))
]
}

Expand Down

0 comments on commit a587044

Please sign in to comment.