diff --git a/Cargo.lock b/Cargo.lock index 3fc69e0..30c1136 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "bitflags" @@ -28,15 +28,15 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "indoc" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "lock_api" @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -86,26 +86,33 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "proc-macro2" -version = "1.0.73" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dd5e8a1f1029c43224ad5898e50140c2aebb1705f19e67c918ebf5b9e797fe1" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] [[package]] name = "pyo3" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82ad98ce1991c9c70c3464ba4187337b9c45fcbbb060d46dca15f0c075e14e2" +checksum = "a02a88a17e74cadbc8ce77855e1d6c8ad0ab82901a4a9b5046bd01c1c0bd95cd" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -114,9 +121,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5503d0b3aee2c7a8dbb389cd87cd9649f675d4c7f60ca33699a3e3859d81a891" +checksum = "a5eb0b6ecba38961f6f4bd6cd5906dfab3cd426ff37b2eed5771006aa31656f1" dependencies = [ "once_cell", "target-lexicon", @@ -124,9 +131,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a79e8d80486a00d11c0dcb27cd2aa17c022cc95c677b461f01797226ba8f41" +checksum = "ba8a6e48a29b5d22e4fdaf132d8ba8d3203ee9f06362d48f244346902a594ec3" dependencies = [ "libc", "pyo3-build-config", @@ -134,9 +141,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4b0dc7eaa578604fab11c8c7ff8934c71249c61d4def8e272c76ed879f03d4" +checksum = "4e80493c5965f94a747d0782a607b2328a4eea5391327b152b00e2f3b001cede" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -146,21 +153,22 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816a4f709e29ddab2e3cdfe94600d554c5556cad0ddfeea95c47b580c3247fa4" +checksum = "fcd7d86f42004025200e12a6a8119bd878329e6fddef8178eaafa4e4b5906c5b" dependencies = [ "heck", "proc-macro2", + "pyo3-build-config", "quote", "syn", ] [[package]] name = "quote" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a37c9326af5ed140c86a46655b5278de879853be5573c01df185b6f49a580a" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -176,7 +184,7 @@ dependencies = [ [[package]] name = "rlviser-py" -version = "0.6.3" +version = "0.6.4" dependencies = [ "pyo3", ] @@ -189,15 +197,15 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "syn" -version = "2.0.44" +version = "2.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d27c2c202598d05175a6dd3af46824b7f747f8d8e9b14c623f19fa5069735d" +checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" dependencies = [ "proc-macro2", "quote", @@ -206,9 +214,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "unicode-ident" diff --git a/Cargo.toml b/Cargo.toml index 3161a66..4434d1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rlviser-py" -version = "0.6.3" +version = "0.6.4" edition = "2021" description = "Python implementation that manages a UDP connection to RLViser" license = "MIT" @@ -16,7 +16,7 @@ name = "rlviser_py" crate-type = ["cdylib"] [dependencies] -pyo3 = "0.20.0" +pyo3 = "0.21.0" [profile.release] lto = true diff --git a/pyproject.toml b/pyproject.toml index 5cacfd9..056f499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,5 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] - [tool.maturin] features = ["pyo3/extension-module", "pyo3/abi3-py37"] diff --git a/rlviser_py.pyi b/rlviser_py.pyi index 12c727c..5a66078 100644 --- a/rlviser_py.pyi +++ b/rlviser_py.pyi @@ -1,4 +1,4 @@ -from typing import List, Optional, Tuple +from typing import Sequence, Optional, Tuple from RocketSim import BallState, CarConfig, CarState, GameMode, Team @@ -7,13 +7,13 @@ type TRotmat = Tuple[TVec3, TVec3, TVec3] type TBall = Tuple[TVec3, TRotmat, TVec3, TVec3] type TCar = Tuple[int, TVec3, TRotmat, TVec3, TVec3, float, bool, bool, bool, float] -def set_boost_pad_locations(locations: List[TVec3]) -> ...: +def set_boost_pad_locations(locations: Sequence[TVec3]) -> ...: pass -def get_state_set() -> Optional[Tuple[List[float], TBall, List[TCar]]]: +def get_state_set() -> Optional[Tuple[Sequence[float], TBall, Sequence[TCar]]]: pass -def render(tick_count: int, tick_rate: float, game_mode: GameMode, boost_pad_states: List[bool], ball: BallState, cars: List[Tuple[int, CarState]]) -> ...: +def render(tick_count: int, tick_rate: float, game_mode: GameMode, boost_pad_states: Sequence[bool], ball: BallState, cars: Sequence[Tuple[int, CarState]]) -> ...: pass def quit() -> ...: diff --git a/src/lib.rs b/src/lib.rs index 676349c..e078cd2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,8 +15,8 @@ macro_rules! pynamedmodule { #[doc = $doc] #[pymodule] #[allow(redundant_semicolons)] - fn $name(_py: Python, m: &PyModule) -> PyResult<()> { - $(m.add_function(wrap_pyfunction!($func_name, m)?)?);*; + fn $name(_py: Python, m: Bound) -> PyResult<()> { + $(m.add_function(wrap_pyfunction!($func_name, &m)?)?);*; $(m.add($var_name, $value)?);*; Ok(()) } @@ -38,7 +38,7 @@ pynamedmodule! { } thread_local! { - static BOOST_PAD_LOCATIONS: RefCell> = RefCell::new(Vec::new()); + static BOOST_PAD_LOCATIONS: RefCell> = const { RefCell::new(Vec::new()) }; } /// Set the boost pad locations to send to RLViser in each packet