Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Tim Orling <ticotimo@gmail.com>
Cc: openembedded-core@lists.openembedded.org,
	Tim Orling <tim.orling@konsulko.com>
Subject: Re: [OE-core] [PATCH v2 4/6] recipetool: add python_maturin support
Date: Sat, 9 Dec 2023 12:29:50 +0100	[thread overview]
Message-ID: <20231209112950eab373e8@mail.local> (raw)
In-Reply-To: <24841a7636bd1e83411c87ba4332f6f863542c6f.1701989368.git.tim.orling@konsulko.com> <ef9e58f253d371c8ae864f7cd89c1fb1dcd3602e.1701989368.git.tim.orling@konsulko.com> <20231209020223.1221046-1-tim.orling@konsulko.com>

Hello,

maturin is not reproducible:

https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20231208-rfbproj4/packages/diff-html/

On 08/12/2023 18:02:24-0800, Tim Orling wrote:
> Add the new python_maturin PEP-517 backend
> 
> Add selftest for 'pydantic-core' pypi package.
> 
> Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> ---
> Changes in v2:
>  - drop all SRC_URI checksums except sha256sum (Peter's change)
>    * requires "[PATCH v2] recipetool: pypi: do not clobber SRC_URI checksums"
>  - drop SRC_URI (Julien's change)
>  - add "inherit pypi" (Julien's change)
> 
>  meta/lib/oeqa/selftest/cases/recipetool.py    | 29 +++++++++++++++++++
>  .../lib/recipetool/create_buildsys_python.py  |  1 +
>  2 files changed, 30 insertions(+)
> 
> diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
> index d10d61bc5b0..8d39f639acf 100644
> --- a/meta/lib/oeqa/selftest/cases/recipetool.py
> +++ b/meta/lib/oeqa/selftest/cases/recipetool.py
> @@ -663,6 +663,35 @@ class RecipetoolCreateTests(RecipetoolBase):
>  
>          self._test_recipe_contents(recipefile, checkvars, inherits)
>  
> +    def test_recipetool_create_python3_pep517_maturin(self):
> +        # This test require python 3.11 or above for the tomllib module
> +        # or tomli module to be installed
> +        try:
> +            import tomllib
> +        except ImportError:
> +            try:
> +                import tomli
> +            except ImportError:
> +                self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module')
> +
> +        # Test creating python3 package from tarball (using maturin class)
> +        temprecipe = os.path.join(self.tempdir, 'recipe')
> +        os.makedirs(temprecipe)
> +        pn = 'pydantic-core'
> +        pv = '2.14.5'
> +        recipefile = os.path.join(temprecipe, 'python3-%s_%s.bb' % (pn, pv))
> +        srcuri = 'https://files.pythonhosted.org/packages/64/26/cffb93fe9c6b5a91c497f37fae14a4b073ecbc47fc36a9979c7aa888b245/pydantic_core-%s.tar.gz' % pv
> +        result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
> +        self.assertTrue(os.path.isfile(recipefile))
> +        checkvars = {}
> +        checkvars['HOMEPAGE'] = 'https://github.com/pydantic/pydantic-core'
> +        checkvars['LICENSE'] = set(['MIT'])
> +        checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=ab599c188b4a314d2856b3a55030c75c'
> +        checkvars['SRC_URI[sha256sum]'] = '6d30226dfc816dd0fdf120cae611dd2215117e4f9b124af8c60ab9093b6e8e71'
> +        inherits = ['python_maturin', 'pypi']
> +
> +        self._test_recipe_contents(recipefile, checkvars, inherits)
> +
>      def test_recipetool_create_github_tarball(self):
>          # Basic test to ensure github URL mangling doesn't apply to release tarballs
>          temprecipe = os.path.join(self.tempdir, 'recipe')
> diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py
> index a2af41fdda8..60c59034504 100644
> --- a/scripts/lib/recipetool/create_buildsys_python.py
> +++ b/scripts/lib/recipetool/create_buildsys_python.py
> @@ -735,6 +735,7 @@ class PythonPyprojectTomlRecipeHandler(PythonRecipeHandler):
>          "poetry.core.masonry.api": "python_poetry_core",
>          "flit_core.buildapi": "python_flit_core",
>          "hatchling.build": "python_hatchling",
> +        "maturin": "python_maturin",
>      }
>  
>      # setuptools.build_meta and flit declare project metadata into the "project" section of pyproject.toml
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#192096): https://lists.openembedded.org/g/openembedded-core/message/192096
> Mute This Topic: https://lists.openembedded.org/mt/103067787/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


On 07/12/2023 15:13:22-0800, Tim Orling wrote:
> Basic smoke test for maturin to test the 'maturin list-python' case.
> 
> [YOCTO #15312]
> 
> Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> ---
>  meta/lib/oeqa/runtime/cases/maturin.py | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>  create mode 100644 meta/lib/oeqa/runtime/cases/maturin.py
> 
> diff --git a/meta/lib/oeqa/runtime/cases/maturin.py b/meta/lib/oeqa/runtime/cases/maturin.py
> new file mode 100644
> index 00000000000..b9a3b4acbcd
> --- /dev/null
> +++ b/meta/lib/oeqa/runtime/cases/maturin.py
> @@ -0,0 +1,23 @@
> +#
> +# Copyright OpenEmbedded Contributors
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +import os
> +
> +from oeqa.runtime.case import OERuntimeTestCase
> +from oeqa.core.decorator.depends import OETestDepends
> +from oeqa.runtime.decorator.package import OEHasPackage
> +
> +class MaturinTest(OERuntimeTestCase):
> +    @OETestDepends(['ssh.SSHTest.test_ssh', 'python.PythonTest.test_python3'])
> +    @OEHasPackage(['python3-maturin'])
> +    def test_maturin_list_python(self):
> +        status, output = self.target.run("maturin list-python")
> +        self.assertEqual(status, 0)
> +        _, py_major = self.target.run("python3 -c 'import sys; print(sys.version_info.major)'")
> +        _, py_minor = self.target.run("python3 -c 'import sys; print(sys.version_info.minor)'")
> +        python_version = "%s.%s" % (py_major, py_minor)
> +        self.assertEqual(output, "🐍 1 python interpreter found:\n"
> +                                 " - CPython %s at /usr/bin/python%s" % (python_version, python_version))
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#191986): https://lists.openembedded.org/g/openembedded-core/message/191986
> Mute This Topic: https://lists.openembedded.org/mt/103045102/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


On 07/12/2023 15:13:23-0800, Tim Orling wrote:
> We expect 'maturin' will be used in SDKs, so it makes sense to also
> test it in the testsdk environment.
> 
> To run this test case, you can add the following to local.conf:
> TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin"
> 
> And the build and test the SDK:
> bitbake -c populate_sdk core-image-full-cmdline
> bitbake -c testsdk core-image-full-cmdline
> 
> You can substitute a different image recipe for "core-image-full-cmdline"
> 
> [YOCTO #15312]
> 
> Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> ---
>  meta/lib/oeqa/sdk/cases/maturin.py | 33 ++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>  create mode 100644 meta/lib/oeqa/sdk/cases/maturin.py
> 
> diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py
> new file mode 100644
> index 00000000000..14245bc36e5
> --- /dev/null
> +++ b/meta/lib/oeqa/sdk/cases/maturin.py
> @@ -0,0 +1,33 @@
> +#
> +# Copyright OpenEmbedded Contributors
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +import unittest
> +from oeqa.sdk.case import OESDKTestCase
> +
> +from oeqa.utils.subprocesstweak import errors_have_output
> +
> +errors_have_output()
> +
> +
> +class MaturinTest(OESDKTestCase):
> +    def setUp(self):
> +        if not (
> +            self.tc.hasHostPackage("nativesdk-python3-maturin")
> +            or self.tc.hasHostPackage("python3-maturin-native")
> +        ):
> +            raise unittest.SkipTest("No python3-maturin package in the SDK")
> +
> +    def test_maturin_list_python(self):
> +        py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'")
> +        py_minor = self._run("python3 -c 'import sys; print(sys.version_info.minor)'")
> +        python_version = "%s.%s" % (py_major.strip(), py_minor.strip())
> +        cmd = "maturin list-python"
> +        output = self._run(cmd)
> +        self.assertRegex(output, r"^🐍 1 python interpreter found:\n")
> +        self.assertRegex(
> +            output,
> +            r" - CPython %s (.+)/usr/bin/python%s$" % (python_version, python_version),
> +        )
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#191987): https://lists.openembedded.org/g/openembedded-core/message/191987
> Mute This Topic: https://lists.openembedded.org/mt/103045103/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 



-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2023-12-09 11:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 23:13 [PATCH 0/6] Add 'maturin' python backend support Tim Orling
2023-12-07 23:13 ` [PATCH 1/6] python3-setuptools-rust: BBCLASSEXTEND + nativesdk Tim Orling
2023-12-07 23:13 ` [PATCH 2/6] python3-maturin: add v1.3.2 Tim Orling
2023-12-07 23:13 ` [PATCH 3/6] classes-recipe: add python_maturin.bbclass Tim Orling
2023-12-07 23:13 ` [PATCH 4/6] recipetool: add python_maturin support Tim Orling
2023-12-08 23:38   ` [OE-core] " Peter Kjellerstedt
2023-12-09  2:02   ` [PATCH v2 " Tim Orling
2023-12-09 11:29     ` Alexandre Belloni [this message]
     [not found]     ` <179F2663983D88F3.26830@lists.openembedded.org>
2023-12-09 11:59       ` [OE-core] " Alexandre Belloni
2023-12-14  0:28         ` Tim Orling
2023-12-07 23:13 ` [PATCH 5/6] oe-selfest: add maturn runtime (testimage) test Tim Orling
2023-12-07 23:13 ` [PATCH 6/6] python3-maturin: add sdk (testsdk) test case Tim Orling
2023-12-08 22:50 ` [OE-core] [PATCH 0/6] Add 'maturin' python backend support Alexandre Belloni
2023-12-08 23:58   ` Tim Orling
     [not found]   ` <179F00AD57313E1B.7956@lists.openembedded.org>
2023-12-09  0:59     ` Tim Orling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231209112950eab373e8@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ticotimo@gmail.com \
    --cc=tim.orling@konsulko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox