summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2023-12-16 21:41:30 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-17 19:07:21 +0000
commit9707dc5549b67fa4ab9e10a52e6eb0ce2f8f50c9 (patch)
tree1a7f722e129f91acc45a913df0c824d5784dedb1
parentca5427280d91444a7b986866a05894719967f0b0 (diff)
downloadpoky-9707dc5549b67fa4ab9e10a52e6eb0ce2f8f50c9.tar.gz
recipetool: add python_maturin support
Add the new python_maturin PEP-517 backend Add selftest for 'pydantic-core' pypi package. (From OE-Core rev: 69b679380616a94a631681caa05d9bf7610f9372) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py29
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py1
2 files changed, 30 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index a19439d88e..df15c80069 100644
--- a/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -670,6 +670,35 @@ class RecipetoolCreateTests(RecipetoolBase):
670 670
671 self._test_recipe_contents(recipefile, checkvars, inherits) 671 self._test_recipe_contents(recipefile, checkvars, inherits)
672 672
673 def test_recipetool_create_python3_pep517_maturin(self):
674 # This test require python 3.11 or above for the tomllib module
675 # or tomli module to be installed
676 try:
677 import tomllib
678 except ImportError:
679 try:
680 import tomli
681 except ImportError:
682 self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module')
683
684 # Test creating python3 package from tarball (using maturin class)
685 temprecipe = os.path.join(self.tempdir, 'recipe')
686 os.makedirs(temprecipe)
687 pn = 'pydantic-core'
688 pv = '2.14.5'
689 recipefile = os.path.join(temprecipe, 'python3-%s_%s.bb' % (pn, pv))
690 srcuri = 'https://files.pythonhosted.org/packages/64/26/cffb93fe9c6b5a91c497f37fae14a4b073ecbc47fc36a9979c7aa888b245/pydantic_core-%s.tar.gz' % pv
691 result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
692 self.assertTrue(os.path.isfile(recipefile))
693 checkvars = {}
694 checkvars['HOMEPAGE'] = 'https://github.com/pydantic/pydantic-core'
695 checkvars['LICENSE'] = set(['MIT'])
696 checkvars['LIC_FILES_CHKSUM'] = 'file://LICENSE;md5=ab599c188b4a314d2856b3a55030c75c'
697 checkvars['SRC_URI[sha256sum]'] = '6d30226dfc816dd0fdf120cae611dd2215117e4f9b124af8c60ab9093b6e8e71'
698 inherits = ['python_maturin', 'pypi']
699
700 self._test_recipe_contents(recipefile, checkvars, inherits)
701
673 def test_recipetool_create_github_tarball(self): 702 def test_recipetool_create_github_tarball(self):
674 # Basic test to ensure github URL mangling doesn't apply to release tarballs 703 # Basic test to ensure github URL mangling doesn't apply to release tarballs
675 temprecipe = os.path.join(self.tempdir, 'recipe') 704 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 a2af41fdda..60c5903450 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -735,6 +735,7 @@ class PythonPyprojectTomlRecipeHandler(PythonRecipeHandler):
735 "poetry.core.masonry.api": "python_poetry_core", 735 "poetry.core.masonry.api": "python_poetry_core",
736 "flit_core.buildapi": "python_flit_core", 736 "flit_core.buildapi": "python_flit_core",
737 "hatchling.build": "python_hatchling", 737 "hatchling.build": "python_hatchling",
738 "maturin": "python_maturin",
738 } 739 }
739 740
740 # setuptools.build_meta and flit declare project metadata into the "project" section of pyproject.toml 741 # setuptools.build_meta and flit declare project metadata into the "project" section of pyproject.toml