[PATCH v3 6/8] python3-pytest: Add recipe

Khem Raj
2020-11-20T17:30:03Z

Moved to OE-Core from meta-python

There are several recipes in various layers which use pytest framework
some of them being in OE-Core, this will help to keep this in core
recipe metadata

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...he-setup_requires-for-setuptools-scm.patch | 39 +++++++++++++++++++
.../python/python3-pytest_6.1.0.bb | 38 ++++++++++++++++++
2 files changed, 77 insertions(+)
create mode 100644 meta/recipes-devtools/python/python3-pytest/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch
create mode 100644 meta/recipes-devtools/python/python3-pytest_6.1.0.bb

diff --git a/meta/recipes-devtools/python/python3-pytest/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch b/meta/recipes-devtools/python/python3-pytest/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch
new file mode 100644
index 0000000000..8c5c17247e
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pytest/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch
@@ -0,0 +1,39 @@
+From ff784f4803ab33f5e3389e40d038d52d1e211843 Mon Sep 17 00:00:00 2001
+From: Yuan Chao <yuanc.fnst@cn.fujitsu.com>
+Date: Wed, 28 Aug 2019 16:12:27 +0900
+Subject: [PATCH] [PATCH] setup.py: remove the setup_requires for
+ setuptools-scm
+
+The setup_requires argument forces the download of the egg file for setuptools-scm
+during the do_compile phase. This download is incompatible with the typical fetch
+and mirror structure. The only usage of scm is the generation of the _version.py
+file and in the release tarball it is already correctly created
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Derek Straka <derek@asterius.io>
+
+Signed-off-by: Yuan Chao <yuanc.fnst@cn.fujitsu.com>
+
+Rebase for pytest 6.1.0.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ setup.cfg | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/setup.cfg b/setup.cfg
+index 60f6564..c4d1471 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -55,7 +55,6 @@ package_dir =
+ =src
+ setup_requires =
+ setuptools>=40.0
+- setuptools-scm
+ zip_safe = no
+
+ [options.entry_points]
+--
+2.17.1
+
diff --git a/meta/recipes-devtools/python/python3-pytest_6.1.0.bb b/meta/recipes-devtools/python/python3-pytest_6.1.0.bb
new file mode 100644
index 0000000000..e3e65986db
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pytest_6.1.0.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Simple powerful testing with python"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=81eb9f71d006c6b268cf4388e3c98f7b"
+
+SRC_URI[sha256sum] = "d010e24666435b39a4cf48740b039885642b6c273a3f77be3e7e03554d2806b7"
+
+SRC_URI_append = " file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch "
+
+inherit update-alternatives pypi setuptools3
+
+RDEPENDS_${PN}_append_class-target = " \
+ ${PYTHON_PN}-attrs \
+ ${PYTHON_PN}-debugger \
+ ${PYTHON_PN}-doctest \
+ ${PYTHON_PN}-iniconfig \
+ ${PYTHON_PN}-json \
+ ${PYTHON_PN}-pluggy \
+ ${PYTHON_PN}-py \
+ ${PYTHON_PN}-setuptools \
+ ${PYTHON_PN}-six \
+ ${PYTHON_PN}-atomicwrites \
+ ${PYTHON_PN}-importlib-metadata \
+ ${PYTHON_PN}-pathlib2 \
+ ${PYTHON_PN}-wcwidth \
+ ${PYTHON_PN}-more-itertools \
+ ${PYTHON_PN}-packaging \
+"
+
+ALTERNATIVE_${PN} += "py.test pytest"
+
+NATIVE_LINK_NAME[pytest] = "${bindir}/pytest"
+ALTERNATIVE_TARGET[pytest] = "${bindir}/pytest"
+
+ALTERNATIVE_LINK_NAME[py.test] = "${bindir}/py.test"
+ALTERNATIVE_TARGET[py.test] = "${bindir}/py.test"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.29.2