From c51bf6ed59166503be3d962e00f5150538c65c0f Mon Sep 17 00:00:00 2001 From: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com> Date: Wed, 26 Jun 2024 08:45:52 +0200 Subject: [PATCH] Move to PyO3 0.22 and add first signature test. --- src/python/Cargo.lock | 58 ++++++++++++++--------------- src/python/Cargo.toml | 2 +- src/python/tests/signature_tests.py | 18 +++++++++ 3 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 src/python/tests/signature_tests.py diff --git a/src/python/Cargo.lock b/src/python/Cargo.lock index db7709e6..c2e39cac 100644 --- a/src/python/Cargo.lock +++ b/src/python/Cargo.lock @@ -128,7 +128,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] @@ -318,7 +318,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] @@ -335,7 +335,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -1051,9 +1051,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1081,15 +1081,15 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +checksum = "1962a33ed2a201c637fc14a4e0fd4e06e6edfdeee6a5fede0dab55507ad74cf7" dependencies = [ "cfg-if", "indoc", "libc", "memoffset 0.9.1", - "parking_lot", + "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -1099,9 +1099,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +checksum = "ab7164b2202753bd33afc7f90a10355a719aa973d1f94502c50d06f3488bc420" dependencies = [ "once_cell", "target-lexicon", @@ -1109,9 +1109,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +checksum = "c6424906ca49013c0829c5c1ed405e20e2da2dc78b82d198564880a704e6a7b7" dependencies = [ "libc", "pyo3-build-config", @@ -1119,34 +1119,34 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +checksum = "82b2f19e153122d64afd8ce7aaa72f06a00f52e34e1d1e74b6d71baea396460a" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] name = "pyo3-macros-backend" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +checksum = "dd698c04cac17cf0fe63d47790ab311b8b25542f5cb976b65c374035c50f1eef" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] name = "quote" -version = "1.0.31" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1300,7 +1300,7 @@ checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] @@ -1401,9 +1401,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -1412,9 +1412,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "termcolor" @@ -1442,7 +1442,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.68", ] [[package]] diff --git a/src/python/Cargo.toml b/src/python/Cargo.toml index a209d646..aa4d233e 100644 --- a/src/python/Cargo.toml +++ b/src/python/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib"] [dependencies] ahash = "0.8.3" -pyo3 = { version = "0.21", features = ["extension-module"] } +pyo3 = { version = "0.22", features = ["extension-module"] } polars = "0.24.3" polars-arrow = "0.24.3" derive_more = "0.99.17" diff --git a/src/python/tests/signature_tests.py b/src/python/tests/signature_tests.py new file mode 100644 index 00000000..15123e9b --- /dev/null +++ b/src/python/tests/signature_tests.py @@ -0,0 +1,18 @@ +from unittest import TestCase +from demoparser2 import DemoParser +import pandas as pd +import unittest + +class SignatureTest(TestCase): + + def test_parse_header_signature(self): + parser = DemoParser("tests/data/test.dem") + header = parser.parse_header() + self.assertTrue(isinstance(header, dict)) + for key, value in header.items(): + self.assertTrue(isinstance(key, str)) + self.assertTrue(isinstance(value, str)) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file