mbox

[v2,0/7] Add 'maturin' backend support

Message ID cover.1702791173.git.tim.orling@konsulko.com
State Not Applicable, archived
Headers show

Pull-request

https://git.yoctoproject.org/poky-contrib timo/maturin_1.4.0

Message

Tim Orling Dec. 17, 2023, 5:41 a.m. UTC
We are increasingly seeing Rust extensions for Python added in the
ecosystem. The current best practices approach has moved from using
'setuptools-rust' to using 'maturin'.

* Add python3-maturin, including 'native' and 'nativesdk' support.
* Add a 'python_maturin' bbclass for the PEP-517 backend.
* Add recipetool support for the 'maturin' PEP-517 backend.
* Add a very basic 'maturin list-python' smoke test to oeqa for
  both 'runtime' (-c testimage) and 'sdk' (-c testsdk).

Changes in v2:
* Bump 'maturin' to v1.4.0
* Fix the reproducible build of the bzip2-sys crate which was causing
  python3-maturin to be non-reproducible.
* Add a more exhaustive 'maturin develop' test case for oeqa 'sdk',
  which exercises:
  - Creation of a python3 virtual environment
  - Fetching crates for the 'guessing-game' app from the maturin tutorial
  - Building dev version of 'guessing-game' crate and wheel

The following changes since commit 5815ccc1f6fd93690a684f7ff0f8a0a19758fdaa:

  build-appliance-image: Update to master head revision (2023-12-16 13:12:52 +0000)

are available in the Git repository at:

  https://git.yoctoproject.org/poky-contrib timo/maturin_1.4.0
  https://git.yoctoproject.org/poky-contrib/log/?h=timo/maturin_1.4.0

Tim Orling (7):
  python3-maturin: add v1.4.0
  python3-maturin: bzip2-sys reproduciblility
  classes-recipe: add python_maturin.bbclass
  recipetool: add python_maturin support
  oe-selfest: add maturn runtime (testimage) test
  oeqa: add simple 'maturin' SDK (testsdk) test case
  oeqa: add "maturin develop" SDK test case

 meta/classes-recipe/python_maturin.bbclass    |  17 +
 meta/conf/distro/include/maintainers.inc      |   1 +
 .../files/maturin/guessing-game/Cargo.toml    |  20 +
 .../maturin/guessing-game/LICENSE-APACHE      | 201 ++++++
 .../files/maturin/guessing-game/LICENSE-MIT   |  25 +
 .../maturin/guessing-game/pyproject.toml      |   8 +
 .../files/maturin/guessing-game/src/lib.rs    |  48 ++
 meta/lib/oeqa/runtime/cases/maturin.py        |  23 +
 meta/lib/oeqa/sdk/cases/maturin.py            |  79 +++
 meta/lib/oeqa/selftest/cases/recipetool.py    |  29 +
 .../python/python3-maturin-crates.inc         | 618 ++++++++++++++++++
 .../python/python3-maturin_1.4.0.bb           |  42 ++
 .../lib/recipetool/create_buildsys_python.py  |   1 +
 13 files changed, 1112 insertions(+)
 create mode 100644 meta/classes-recipe/python_maturin.bbclass
 create mode 100644 meta/lib/oeqa/files/maturin/guessing-game/Cargo.toml
 create mode 100644 meta/lib/oeqa/files/maturin/guessing-game/LICENSE-APACHE
 create mode 100644 meta/lib/oeqa/files/maturin/guessing-game/LICENSE-MIT
 create mode 100644 meta/lib/oeqa/files/maturin/guessing-game/pyproject.toml
 create mode 100644 meta/lib/oeqa/files/maturin/guessing-game/src/lib.rs
 create mode 100644 meta/lib/oeqa/runtime/cases/maturin.py
 create mode 100644 meta/lib/oeqa/sdk/cases/maturin.py
 create mode 100644 meta/recipes-devtools/python/python3-maturin-crates.inc
 create mode 100644 meta/recipes-devtools/python/python3-maturin_1.4.0.bb