diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/recipetool.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 8e0fc995f7..b64f724b8f 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
@@ -576,6 +576,41 @@ class RecipetoolCreateTests(RecipetoolBase): | |||
576 | 576 | ||
577 | self._test_recipe_contents(recipefile, checkvars, inherits) | 577 | self._test_recipe_contents(recipefile, checkvars, inherits) |
578 | 578 | ||
579 | def test_recipetool_create_python3_pep517_hatchling(self): | ||
580 | # This test require python 3.11 or above for the tomllib module | ||
581 | # or tomli module to be installed | ||
582 | try: | ||
583 | import tomllib | ||
584 | except ImportError: | ||
585 | try: | ||
586 | import tomli | ||
587 | except ImportError: | ||
588 | self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') | ||
589 | |||
590 | # Test creating python3 package from tarball (using hatchling class) | ||
591 | temprecipe = os.path.join(self.tempdir, 'recipe') | ||
592 | os.makedirs(temprecipe) | ||
593 | pn = 'jsonschema' | ||
594 | pv = '4.19.1' | ||
595 | recipefile = os.path.join(temprecipe, 'python3-%s_%s.bb' % (pn, pv)) | ||
596 | srcuri = 'https://files.pythonhosted.org/packages/e4/43/087b24516db11722c8687e0caf0f66c7785c0b1c51b0ab951dfde924e3f5/jsonschema-%s.tar.gz' % pv | ||
597 | result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) | ||
598 | self.assertTrue(os.path.isfile(recipefile)) | ||
599 | checkvars = {} | ||
600 | checkvars['SUMMARY'] = 'An implementation of JSON Schema validation for Python' | ||
601 | checkvars['HOMEPAGE'] = 'https://github.com/python-jsonschema/jsonschema' | ||
602 | checkvars['LICENSE'] = set(['MIT']) | ||
603 | checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 file://json/LICENSE;md5=9d4de43111d33570c8fe49b4cb0e01af' | ||
604 | checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/e4/43/087b24516db11722c8687e0caf0f66c7785c0b1c51b0ab951dfde924e3f5/jsonschema-${PV}.tar.gz' | ||
605 | checkvars['SRC_URI[md5sum]'] = '4d6667ce76f820c35082c2d60a4896ab' | ||
606 | checkvars['SRC_URI[sha1sum]'] = '9173714cb88964d07f3a3f4fcaaef638b8ceac0c' | ||
607 | checkvars['SRC_URI[sha256sum]'] = 'ec84cc37cfa703ef7cd4928db24f9cb31428a5d0fa77747b8b51a847458e0bbf' | ||
608 | checkvars['SRC_URI[sha384sum]'] = '7a53181f0e679aa3dc3eb4d05a420877b7b9bff2d02e81f5c289a37ed1127d6c0cca1f5a5f9e4e166f089ab36bcc2be9' | ||
609 | checkvars['SRC_URI[sha512sum]'] = '60fa769faf6e3fc2c14eb9acd189c86e9d366b157230a5681d36552af0c159cb1ad33fd920668a36afdab98bc97253f91501704c5c07b5009fdaf9d29b52060d' | ||
610 | inherits = ['python_hatchling'] | ||
611 | |||
612 | self._test_recipe_contents(recipefile, checkvars, inherits) | ||
613 | |||
579 | def test_recipetool_create_github_tarball(self): | 614 | def test_recipetool_create_github_tarball(self): |
580 | # Basic test to ensure github URL mangling doesn't apply to release tarballs | 615 | # Basic test to ensure github URL mangling doesn't apply to release tarballs |
581 | temprecipe = os.path.join(self.tempdir, 'recipe') | 616 | temprecipe = os.path.join(self.tempdir, 'recipe') |