Skip to contentSkip to conversation

python3-requests-toolbelt: add ptest

PATCH In review Sakib Sajal 2 participants 9 messages Jul 10, 2020 – Jul 12, 2020

lore
Share & tools
lore
#0 lore raw

cover python3-requests-toolbelt: add ptest

These recipes are required to enable
ptest for python3-requests-toolbelt
and are brought in from meta-cloud-services.
i) python3-mock_4.0.1.bb
ii) python3-pep8_1.7.1.bb
iii) python3-mccabe_0.2.1.bb

The original recipes remain in meta-cloud-services. The .inc and .bb have been consolidated into one .bb file.

Sakib Sajal (4):
python3-mock: add recipe for v4.0.1
python3-pep8: add recipe for v1.7.1
python3-mccabe: add recipe for v0.2.1
python3-requests-toolbelt: add ptest

 .../python/python3-mccabe_0.2.1.bb            | 15 +++++++++++++
 .../python/python3-mock_4.0.1.bb              | 17 ++++++++++++++
 .../python/python3-pep8_1.7.1.bb              | 17 ++++++++++++++
 .../python3-requests-toolbelt/run-ptest       |  3 +++
 .../python/python3-requests-toolbelt_0.9.1.bb | 22 +++++++++++++++++--
 5 files changed, 72 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-mccabe_0.2.1.bb
 create mode 100644 meta-python/recipes-devtools/python/python3-mock_4.0.1.bb
 create mode 100644 meta-python/recipes-devtools/python/python3-pep8_1.7.1.bb
 create mode 100644 meta-python/recipes-devtools/python/python3-requests-toolbelt/run-ptest
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/4 python3-mock: add recipe for v4.0.1

Recipe is brought in from meta-cloud-services

---
 .../python/python3-mock_4.0.1.bb                | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-mock_4.0.1.bb
meta-python/recipes-devtools/python/python3-mock_4.0.1.bb new file +17 -0
new file mode 100644
index 000000000..eebfcdade
@@ -0,0 +1,17 @@
+DESCRIPTION = "A Python Mocking and Patching Library for Testing"
+HOMEPAGE = "https://pypi.python.org/pypi/mock"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=de9dfbf780446b18aab11f00baaf5b7e"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-prettytable \
+            ${PYTHON_PN}-cmd2 \
+            ${PYTHON_PN}-pyparsing \
+            ${PYTHON_PN}-mccabe \
+            ${PYTHON_PN}-pep8 \
+            ${PYTHON_PN}-pyflakes"
+
+SRC_URI[md5sum] = "8f48ba3fd059e7cfad92f8354064adfd"
+SRC_URI[sha256sum] = "2a572b715f09dd2f0a583d8aeb5bb67d7ed7a8fd31d193cf1227a99c16a67bc3"
Signature · 1 line
2.27.0
Acked-by on v1 1/4
#2 lore raw

Re: [oe] [meta-python][PATCH 1/4] python3-mock: add recipe for v4.0.1

Quoted 3 lines · Sakib Sajal

Recipe is brought in from meta-cloud-services

Quoted 30 lines
---
  .../python/python3-mock_4.0.1.bb                | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)

create mode 100644 meta-python/recipes-devtools/python/python3-mock_4.0.1.bb

meta-python/recipes-devtools/python/python3-mock_4.0.1.bb new file +17 -0
new file mode 100644
index 000000000..eebfcdade
@@ -0,0 +1,17 @@
+DESCRIPTION = "A Python Mocking and Patching Library for Testing"
+HOMEPAGE = "https://pypi.python.org/pypi/mock"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=de9dfbf780446b18aab11f00baaf5b7e"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-prettytable \
+            ${PYTHON_PN}-cmd2 \
+            ${PYTHON_PN}-pyparsing \
+            ${PYTHON_PN}-mccabe \
+            ${PYTHON_PN}-pep8 \
+            ${PYTHON_PN}-pyflakes"
+
+SRC_URI[md5sum] = "8f48ba3fd059e7cfad92f8354064adfd"
+SRC_URI[sha256sum] = "2a572b715f09dd2f0a583d8aeb5bb67d7ed7a8fd31d193cf1227a99c16a67bc3"
#3 lore raw

PATCH 2/4 python3-pep8: add recipe for v1.7.1

In reply to Sakib Sajal

Recipe is brought in from meta-cloud-services

---
 .../python/python3-pep8_1.7.1.bb                | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pep8_1.7.1.bb
meta-python/recipes-devtools/python/python3-pep8_1.7.1.bb new file +17 -0
new file mode 100644
index 000000000..8291281ca
@@ -0,0 +1,17 @@
+DESCRIPTION = "Python style guide checker"
+HOMEPAGE = "https://github.com/dreamhost/cliff"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://README.rst;md5=d8ebbbe831259ce010179d2f310b0f3e"
+
+SRC_URI[md5sum] = "a03bb494859e87b42601b61b1b043a0c"
+SRC_URI[sha256sum] = "603a46e5c358ce20ac4807a0eeafac7505d1125a4c1bd8378757ada06f61bed8"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-prettytable \
+            ${PYTHON_PN}-cmd2 \
+            ${PYTHON_PN}-pyparsing"
+
+SRC_URI[md5sum] = "603821d06db945c71d811b5a8d78423c"
+SRC_URI[sha256sum] = "fe249b52e20498e59e0b5c5256aa52ee99fc295b26ec9eaa85776ffdb9fe6374"
Signature · 1 line
2.27.0
Acked-by on v1 2/4
#4 lore raw

Re: [oe] [meta-python][PATCH 2/4] python3-pep8: add recipe for v1.7.1

Quoted 3 lines · Sakib Sajal

Recipe is brought in from meta-cloud-services

Quoted 30 lines
---
  .../python/python3-pep8_1.7.1.bb                | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)

create mode 100644 meta-python/recipes-devtools/python/python3-pep8_1.7.1.bb

meta-python/recipes-devtools/python/python3-pep8_1.7.1.bb new file +17 -0
new file mode 100644
index 000000000..8291281ca
@@ -0,0 +1,17 @@
+DESCRIPTION = "Python style guide checker"
+HOMEPAGE = "https://github.com/dreamhost/cliff"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://README.rst;md5=d8ebbbe831259ce010179d2f310b0f3e"
+
+SRC_URI[md5sum] = "a03bb494859e87b42601b61b1b043a0c"
+SRC_URI[sha256sum] = "603a46e5c358ce20ac4807a0eeafac7505d1125a4c1bd8378757ada06f61bed8"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-prettytable \
+            ${PYTHON_PN}-cmd2 \
+            ${PYTHON_PN}-pyparsing"
+
+SRC_URI[md5sum] = "603821d06db945c71d811b5a8d78423c"
+SRC_URI[sha256sum] = "fe249b52e20498e59e0b5c5256aa52ee99fc295b26ec9eaa85776ffdb9fe6374"
#5 lore raw

PATCH 3/4 python3-mccabe: add recipe for v0.2.1

In reply to Sakib Sajal

Recipe is brought in from meta-cloud-services

---
 .../python/python3-mccabe_0.2.1.bb                | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-mccabe_0.2.1.bb
meta-python/recipes-devtools/python/python3-mccabe_0.2.1.bb new file +15 -0
new file mode 100644
index 000000000..d3a9971e4
@@ -0,0 +1,15 @@
+DESCRIPTION = "McCabe checker, plugin for flake8"
+HOMEPAGE = "https://github.com/dreamhost/cliff"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://README.rst;md5=aa0383f6aee4f5c20084a97cd13164c4"
+
+SRC_URI[md5sum] = "5a3f3fa6a4bad126c88aaaa7dab682f5"
+SRC_URI[sha256sum] = "5a2a170e47de5593a6abfae1e9542bd2c3924ac62bbe4e6ed96c953c0352243a"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-prettytable \
+            ${PYTHON_PN}-cmd2 \
+            ${PYTHON_PN}-pyparsing \
+           "
Signature · 1 line
2.27.0
Acked-by on v1 3/4
#6 lore raw

Re: [oe] [meta-python][PATCH 3/4] python3-mccabe: add recipe for v0.2.1

Quoted 3 lines · Sakib Sajal

Recipe is brought in from meta-cloud-services

Quoted 28 lines
---
  .../python/python3-mccabe_0.2.1.bb                | 15 +++++++++++++++
  1 file changed, 15 insertions(+)

create mode 100644 meta-python/recipes-devtools/python/python3-mccabe_0.2.1.bb

meta-python/recipes-devtools/python/python3-mccabe_0.2.1.bb new file +15 -0
new file mode 100644
index 000000000..d3a9971e4
@@ -0,0 +1,15 @@
+DESCRIPTION = "McCabe checker, plugin for flake8"
+HOMEPAGE = "https://github.com/dreamhost/cliff"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://README.rst;md5=aa0383f6aee4f5c20084a97cd13164c4"
+
+SRC_URI[md5sum] = "5a3f3fa6a4bad126c88aaaa7dab682f5"
+SRC_URI[sha256sum] = "5a2a170e47de5593a6abfae1e9542bd2c3924ac62bbe4e6ed96c953c0352243a"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-prettytable \
+            ${PYTHON_PN}-cmd2 \
+            ${PYTHON_PN}-pyparsing \
+           "
#7 lore raw

PATCH 4/4 python3-requests-toolbelt: add ptest

In reply to Sakib Sajal
---
 .../python3-requests-toolbelt/run-ptest       |  3 +++
 .../python/python3-requests-toolbelt_0.9.1.bb | 22 +++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-requests-toolbelt/run-ptest
meta-python/recipes-devtools/python/python3-requests-toolbelt/run-ptest new file +3 -0
new file mode 100644
index 000000000..b63c4de0d
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb +20 -2
index 3beb39718..cb1bc607b 100644
@@ -5,12 +5,30 @@ AUTHOR = "Ian Cordasco, Cory Benfield"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571"
 
+SRC_URI = "file://run-ptest \
+          "
+
 SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e"
 SRC_URI[sha256sum] = "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
 
-inherit setuptools3
-inherit pypi
+inherit pypi setuptools3 ptest
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-requests (>=2.0.1) \
 "
+
+RDEPENDS_${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+	${PYTHON_PN}-betamax \
+	${PYTHON_PN}-mock \
+	${PYTHON_PN}-multiprocessing \
+"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/tests
+	cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+	cp -rf ${S}/setup.py ${D}${PTEST_PATH}
+	# remove test test_multipart_encoder.py as it fails,
+	# downloaded file is not supported
+	rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py
+}
Signature · 1 line
2.27.0
Acked-by on v1 4/4
#8 lore raw
Quoted 1 line · Sakib Sajal
Quoted 54 lines
---
  .../python3-requests-toolbelt/run-ptest       |  3 +++
  .../python/python3-requests-toolbelt_0.9.1.bb | 22 +++++++++++++++++--
  2 files changed, 23 insertions(+), 2 deletions(-)

create mode 100644 meta-python/recipes-devtools/python/python3-requests-toolbelt/run-ptest

meta-python/recipes-devtools/python/python3-requests-toolbelt/run-ptest new file +3 -0
new file mode 100644
index 000000000..b63c4de0d
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb +20 -2
index 3beb39718..cb1bc607b 100644
@@ -5,12 +5,30 @@ AUTHOR = "Ian Cordasco, Cory Benfield"
  LICENSE = "Apache-2.0"
  LIC_FILES_CHKSUM = "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571"
 
+SRC_URI = "file://run-ptest \
+          "
+
  SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e"
  SRC_URI[sha256sum] = "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
 
-inherit setuptools3
-inherit pypi
+inherit pypi setuptools3 ptest
 
  RDEPENDS_${PN} += " \
      ${PYTHON_PN}-requests (>=2.0.1) \
  "
+
+RDEPENDS_${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+	${PYTHON_PN}-betamax \
+	${PYTHON_PN}-mock \
+	${PYTHON_PN}-multiprocessing \
+"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/tests
+	cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+	cp -rf ${S}/setup.py ${D}${PTEST_PATH}
+	# remove test test_multipart_encoder.py as it fails,
+	# downloaded file is not supported
+	rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py
+}