summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2023-12-16 21:41:33 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-17 19:04:40 +0000
commit5265dd0b102cd7f3c6bb2ae1b18e9f625b834b39 (patch)
treea5627ae99b3d5c0c8b7b9462c746be0ef398246e /meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml
parent7ceff48625d01a0e60eb761a9a668d0c942cda89 (diff)
downloadopenembedded-core-5265dd0b102cd7f3c6bb2ae1b18e9f625b834b39.tar.gz
oeqa: add "maturin develop" SDK test case
'maturin develop' first checks that a virtual environment has been created, which is a good test for our python3 SDK environment ;) Source for guessing-game lifted from https://www.maturin.rs/tutorial The test case is expected to fetch any necessary crates, build a development version of the crate and package it as a wheel Needs at a minimum the following in e.g. local.conf: TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin" SDK_INCLUDE_TOOLCHAIN = '1' SDK_TOOLCHAIN_LANGS += 'rust' The output of 'maturin develop' should be something like: ... 🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8 🐍 Not using a specific python interpreter 📡 Using build options features from pyproject.toml ... Compiling guessing-game v0.1.0 (/path/to/guessing-game) Finished dev [unoptimized + debuginfo] target(s) in 7.14s 📦 Built wheel for abi3 Python ≥ 3.8 to /path/to/tmpdir/guessing_game-0.1.0-cp38-abi3-linux_x86_64.whl 🛠 Installed guessing-game-0.1.0 Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml')
-rw-r--r--meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml b/meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml
new file mode 100644
index 0000000000..de95025e86
--- /dev/null
+++ b/meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml
@@ -0,0 +1,20 @@
+[package]
+name = "guessing-game"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[lib]
+name = "guessing_game"
+# "cdylib" is necessary to produce a shared library for Python to import from.
+crate-type = ["cdylib"]
+
+[dependencies]
+rand = "0.8.4"
+
+[dependencies.pyo3]
+version = "0.19.0"
+# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
+features = ["abi3-py38"]
+