diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 19 | ||||
-rw-r--r-- | scripts/lib/recipetool/create_buildsys_python.py | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 83361814df..2eca1800de 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
@@ -676,6 +676,25 @@ class RecipetoolCreateTests(RecipetoolBase): | |||
676 | 676 | ||
677 | self._test_recipe_contents(recipefile, checkvars, inherits) | 677 | self._test_recipe_contents(recipefile, checkvars, inherits) |
678 | 678 | ||
679 | def test_recipetool_create_python3_pep517_mesonpy(self): | ||
680 | # This test require python 3.11 or above for the tomllib module or tomli module to be installed | ||
681 | needTomllib(self) | ||
682 | |||
683 | # Test creating python3 package from tarball (using mesonpy class) | ||
684 | temprecipe = os.path.join(self.tempdir, 'recipe') | ||
685 | os.makedirs(temprecipe) | ||
686 | pn = 'siphash24' | ||
687 | pv = '1.4' | ||
688 | recipefile = os.path.join(temprecipe, 'python3-%s_%s.bb' % (pn, pv)) | ||
689 | srcuri = 'https://files.pythonhosted.org/packages/c2/32/b934a70592f314afcfa86c7f7e388804a8061be65b822e2aa07e573b6477/%s-%s.tar.gz' % (pn, pv) | ||
690 | result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) | ||
691 | self.assertTrue(os.path.isfile(recipefile)) | ||
692 | checkvars = {} | ||
693 | checkvars['SRC_URI[sha256sum]'] = '7fd65e39b2a7c8c4ddc3a168a687f4610751b0ac2ebb518783c0cdfc30bec4a0' | ||
694 | inherits = ['python_mesonpy', 'pypi'] | ||
695 | |||
696 | self._test_recipe_contents(recipefile, checkvars, inherits) | ||
697 | |||
679 | def test_recipetool_create_github_tarball(self): | 698 | def test_recipetool_create_github_tarball(self): |
680 | # Basic test to ensure github URL mangling doesn't apply to release tarballs. | 699 | # Basic test to ensure github URL mangling doesn't apply to release tarballs. |
681 | # Deliberately use an older release of Meson at present so we don't need a toml parser. | 700 | # Deliberately use an older release of Meson at present so we don't need a toml parser. |
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index a589343cfb..a807dafae5 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py | |||
@@ -739,6 +739,7 @@ class PythonPyprojectTomlRecipeHandler(PythonRecipeHandler): | |||
739 | "flit_core.buildapi": "python_flit_core", | 739 | "flit_core.buildapi": "python_flit_core", |
740 | "hatchling.build": "python_hatchling", | 740 | "hatchling.build": "python_hatchling", |
741 | "maturin": "python_maturin", | 741 | "maturin": "python_maturin", |
742 | "mesonpy": "python_mesonpy", | ||
742 | } | 743 | } |
743 | 744 | ||
744 | # setuptools.build_meta and flit declare project metadata into the "project" section of pyproject.toml | 745 | # setuptools.build_meta and flit declare project metadata into the "project" section of pyproject.toml |
@@ -779,6 +780,8 @@ class PythonPyprojectTomlRecipeHandler(PythonRecipeHandler): | |||
779 | "python3-poetry-core-native", | 780 | "python3-poetry-core-native", |
780 | # already provided by python_flit_core.bbclass | 781 | # already provided by python_flit_core.bbclass |
781 | "python3-flit-core-native", | 782 | "python3-flit-core-native", |
783 | # already provided by python_mesonpy | ||
784 | "python3-meson-python-native", | ||
782 | ] | 785 | ] |
783 | 786 | ||
784 | # add here a list of known and often used packages and the corresponding bitbake package | 787 | # add here a list of known and often used packages and the corresponding bitbake package |
@@ -790,6 +793,7 @@ class PythonPyprojectTomlRecipeHandler(PythonRecipeHandler): | |||
790 | "setuptools-scm": "python3-setuptools-scm", | 793 | "setuptools-scm": "python3-setuptools-scm", |
791 | "hatchling": "python3-hatchling", | 794 | "hatchling": "python3-hatchling", |
792 | "hatch-vcs": "python3-hatch-vcs", | 795 | "hatch-vcs": "python3-hatch-vcs", |
796 | "meson-python" : "python3-meson-python", | ||
793 | } | 797 | } |
794 | 798 | ||
795 | def __init__(self): | 799 | def __init__(self): |