From patchwork Sun Sep 19 12:45:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1529829 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@lists.buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HC6qj20ySz9sPf for ; Sun, 19 Sep 2021 22:45:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D43A2400E4; Sun, 19 Sep 2021 12:45:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CmrJSe6hBzTR; Sun, 19 Sep 2021 12:45:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id B1437400E7; Sun, 19 Sep 2021 12:45:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2F9D51BF2F3 for ; Sun, 19 Sep 2021 12:45:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2988D83E9B for ; Sun, 19 Sep 2021 12:45:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lFGqyvoES7dR for ; Sun, 19 Sep 2021 12:45:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp1.osuosl.org (Postfix) with ESMTPS id 99A5D83E99 for ; Sun, 19 Sep 2021 12:45:24 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 0EBB520003; Sun, 19 Sep 2021 12:45:20 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 19 Sep 2021 14:45:14 +0200 Message-Id: <20210919124517.524402-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> References: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/4] package/python-{smmap2, gitdb2}: bump versions to 4.0.0 and 4.0.7 X-BeenThere: buildroot@lists.buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeremy Connat , Asaf Kahlon , Thomas Petazzoni , Ricardo Martincoski Errors-To: buildroot-bounces@lists.buildroot.org Sender: "buildroot" This commit bumps the python-smmap2 and python-gitdb2 packages in lockstep, as the new version of gitdb2 requires a newer version of smmap2, but the current version of gitdb2 cannot work with the newer version of smmap2 (sigh). Also, upstream the projects have been renamed: gitdb2 is now named gitdb on PyPi (see https://pypi.org/project/gitdb2/) and smmap2 is now named smmap (https://pypi.org/project/smmap2/). However, to avoid needless churn, we don't rename the Buildroot packages, but that rename is visible in the name of the tarballs being downloaded. Also, since version 4.0.0, smmap supports only Python 3.x, so we add a dependency on Python 3.x and drop the test case of gitdb2 on Python 2.x. Signed-off-by: Thomas Petazzoni --- package/python-gitdb2/Config.in | 4 ++-- package/python-gitdb2/python-gitdb2.hash | 6 +++--- package/python-gitdb2/python-gitdb2.mk | 6 +++--- package/python-smmap2/Config.in | 1 + package/python-smmap2/python-smmap2.hash | 6 +++--- package/python-smmap2/python-smmap2.mk | 6 +++--- support/testing/tests/package/test_python_gitdb2.py | 10 ---------- support/testing/tests/package/test_python_smmap2.py | 10 ---------- 8 files changed, 15 insertions(+), 34 deletions(-) diff --git a/package/python-gitdb2/Config.in b/package/python-gitdb2/Config.in index a5962e7b77..158e4b6980 100644 --- a/package/python-gitdb2/Config.in +++ b/package/python-gitdb2/Config.in @@ -1,8 +1,8 @@ config BR2_PACKAGE_PYTHON_GITDB2 bool "python-gitdb2" + depends on BR2_PACKAGE_PYTHON3 select BR2_PACKAGE_PYTHON_SMMAP2 # runtime - select BR2_PACKAGE_PYTHON_ZLIB if BR2_PACKAGE_PYTHON # runtime - select BR2_PACKAGE_PYTHON3_ZLIB if BR2_PACKAGE_PYTHON3 # runtime + select BR2_PACKAGE_PYTHON3_ZLIB help GitDB allows you to access bare git repositories for reading and writing. It aims at allowing full access to loose objects diff --git a/package/python-gitdb2/python-gitdb2.hash b/package/python-gitdb2/python-gitdb2.hash index e97d25cf4f..7d9bf78f70 100644 --- a/package/python-gitdb2/python-gitdb2.hash +++ b/package/python-gitdb2/python-gitdb2.hash @@ -1,5 +1,5 @@ -# md5, sha256 from https://pypi.org/pypi/gitdb2/json -md5 1a7ea3362e405f8a5634f7ee53636094 gitdb2-2.0.6.tar.gz -sha256 1b6df1433567a51a4a9c1a5a0de977aa351a405cc56d7d35f3388bad1f630350 gitdb2-2.0.6.tar.gz +# md5, sha256 from https://pypi.org/pypi/gitdb/json +md5 3f52187435ab0b6e64a15782ffaf29ab gitdb-4.0.7.tar.gz +sha256 96bf5c08b157a666fec41129e6d327235284cca4c81e92109260f353ba138005 gitdb-4.0.7.tar.gz # Locally computed sha256 checksums sha256 efd29f596a08e8857e68e7694a50bcda72839792da7c3f041bcbff5f18009239 LICENSE diff --git a/package/python-gitdb2/python-gitdb2.mk b/package/python-gitdb2/python-gitdb2.mk index 7664a13504..91a17e24a7 100644 --- a/package/python-gitdb2/python-gitdb2.mk +++ b/package/python-gitdb2/python-gitdb2.mk @@ -4,9 +4,9 @@ # ################################################################################ -PYTHON_GITDB2_VERSION = 2.0.6 -PYTHON_GITDB2_SOURCE = gitdb2-$(PYTHON_GITDB2_VERSION).tar.gz -PYTHON_GITDB2_SITE = https://files.pythonhosted.org/packages/c5/62/ed7205331e8d7cc377e2512cb32f8f8f075c0defce767551d0a76e102ce2 +PYTHON_GITDB2_VERSION = 4.0.7 +PYTHON_GITDB2_SOURCE = gitdb-$(PYTHON_GITDB2_VERSION).tar.gz +PYTHON_GITDB2_SITE = https://files.pythonhosted.org/packages/34/fe/9265459642ab6e29afe734479f94385870e8702e7f892270ed6e52dd15bf PYTHON_GITDB2_SETUP_TYPE = setuptools PYTHON_GITDB2_LICENSE = BSD-3-Clause PYTHON_GITDB2_LICENSE_FILES = LICENSE diff --git a/package/python-smmap2/Config.in b/package/python-smmap2/Config.in index 21a3bdb613..1d4b1fabbe 100644 --- a/package/python-smmap2/Config.in +++ b/package/python-smmap2/Config.in @@ -1,5 +1,6 @@ config BR2_PACKAGE_PYTHON_SMMAP2 bool "python-smmap2" + depends on BR2_PACKAGE_PYTHON3 help Smmap wraps an interface around mmap and tracks the mapped files as well as the amount of clients who use it. If the diff --git a/package/python-smmap2/python-smmap2.hash b/package/python-smmap2/python-smmap2.hash index 8a7ea42a5d..9ae758fc62 100644 --- a/package/python-smmap2/python-smmap2.hash +++ b/package/python-smmap2/python-smmap2.hash @@ -1,5 +1,5 @@ -# md5, sha256 from https://pypi.org/pypi/smmap2/json -md5 1c59a985be5aa645c4c5a4e063a40dd5 smmap2-2.0.5.tar.gz -sha256 29a9ffa0497e7f2be94ca0ed1ca1aa3cd4cf25a1f6b4f5f87f74b46ed91d609a smmap2-2.0.5.tar.gz +# md5, sha256 from https://pypi.org/pypi/smmap/json +md5 61882572be57023980c36f5493523077 smmap-4.0.0.tar.gz +sha256 7e65386bd122d45405ddf795637b7f7d2b532e7e401d46bbe3fb49b9986d5182 smmap-4.0.0.tar.gz # Locally computed sha256 checksums sha256 88e9d93f708d110b328a834302dd1d5c6afbda530e7721d15d80b3511d86f235 LICENSE diff --git a/package/python-smmap2/python-smmap2.mk b/package/python-smmap2/python-smmap2.mk index daf379fe1a..bcf20206ce 100644 --- a/package/python-smmap2/python-smmap2.mk +++ b/package/python-smmap2/python-smmap2.mk @@ -4,9 +4,9 @@ # ################################################################################ -PYTHON_SMMAP2_VERSION = 2.0.5 -PYTHON_SMMAP2_SOURCE = smmap2-$(PYTHON_SMMAP2_VERSION).tar.gz -PYTHON_SMMAP2_SITE = https://files.pythonhosted.org/packages/3b/ba/e49102b3e8ffff644edded25394b2d22ebe3e645f3f6a8139129c4842ffe +PYTHON_SMMAP2_VERSION = 4.0.0 +PYTHON_SMMAP2_SOURCE = smmap-$(PYTHON_SMMAP2_VERSION).tar.gz +PYTHON_SMMAP2_SITE = https://files.pythonhosted.org/packages/dd/d4/2b4f196171674109f0fbb3951b8beab06cd0453c1b247ec0c4556d06648d PYTHON_SMMAP2_SETUP_TYPE = setuptools PYTHON_SMMAP2_LICENSE = BSD-3-Clause PYTHON_SMMAP2_LICENSE_FILES = LICENSE diff --git a/support/testing/tests/package/test_python_gitdb2.py b/support/testing/tests/package/test_python_gitdb2.py index fc55f20821..9e22df06b5 100644 --- a/support/testing/tests/package/test_python_gitdb2.py +++ b/support/testing/tests/package/test_python_gitdb2.py @@ -1,16 +1,6 @@ from tests.package.test_python import TestPythonPackageBase -class TestPythonPy2Gitdb2(TestPythonPackageBase): - __test__ = True - config = TestPythonPackageBase.config + \ - """ - BR2_PACKAGE_PYTHON=y - BR2_PACKAGE_PYTHON_GITDB2=y - """ - sample_scripts = ["tests/package/sample_python_gitdb2.py"] - - class TestPythonPy3Gitdb2(TestPythonPackageBase): __test__ = True config = TestPythonPackageBase.config + \ diff --git a/support/testing/tests/package/test_python_smmap2.py b/support/testing/tests/package/test_python_smmap2.py index 07c0e6621e..a6434c5705 100644 --- a/support/testing/tests/package/test_python_smmap2.py +++ b/support/testing/tests/package/test_python_smmap2.py @@ -1,16 +1,6 @@ from tests.package.test_python import TestPythonPackageBase -class TestPythonPy2Smmap2(TestPythonPackageBase): - __test__ = True - config = TestPythonPackageBase.config + \ - """ - BR2_PACKAGE_PYTHON=y - BR2_PACKAGE_PYTHON_SMMAP2=y - """ - sample_scripts = ["tests/package/sample_python_smmap2.py"] - - class TestPythonPy3Smmap2(TestPythonPackageBase): __test__ = True config = TestPythonPackageBase.config + \ From patchwork Sun Sep 19 12:45:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1529828 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@lists.buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HC6qT4DChz9sPf for ; Sun, 19 Sep 2021 22:45:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9947160765; Sun, 19 Sep 2021 12:45:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wP9VN_QfiLxX; Sun, 19 Sep 2021 12:45:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 002A660729; Sun, 19 Sep 2021 12:45:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C7A0A1BF2F3 for ; Sun, 19 Sep 2021 12:45:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B62E983EA8 for ; Sun, 19 Sep 2021 12:45:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qwCgNlugD_f0 for ; Sun, 19 Sep 2021 12:45:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by smtp1.osuosl.org (Postfix) with ESMTPS id 75EA083E8F for ; Sun, 19 Sep 2021 12:45:24 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6A332C0006; Sun, 19 Sep 2021 12:45:22 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 19 Sep 2021 14:45:15 +0200 Message-Id: <20210919124517.524402-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> References: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/4] support/testing/tests/package/test_python_flask: new test X-BeenThere: buildroot@lists.buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lionel Flandrin , Thomas Petazzoni , Jeremy Connat , Ricardo Martincoski Errors-To: buildroot-bounces@lists.buildroot.org Sender: "buildroot" This commit adds a test for python-flask package. As we are about to add python-flask-expects-json together with a test, it made sense to also add a test for python-flask itself. As far as the DEVELOPERS file is concerned, the test files are added both to the existing maintainer of package/python-flask, as well as to myself. Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 4 +++ .../tests/package/sample_python_flask.py | 7 +++++ .../tests/package/test_python_flask.py | 29 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 support/testing/tests/package/sample_python_flask.py create mode 100644 support/testing/tests/package/test_python_flask.py diff --git a/DEVELOPERS b/DEVELOPERS index 98628d3992..6ed62450a1 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1565,6 +1565,8 @@ F: package/python-daemonize/ F: package/python-flask/ F: package/python-flask-babel/ F: package/python-gunicorn/ +F: support/testing/tests/package/sample_python_flask.py +F: support/testing/tests/package/test_python_flask.py N: Lionel Orry F: package/mongrel2/ @@ -2693,7 +2695,9 @@ F: package/wayland/ F: package/weston/ F: support/testing/tests/boot/test_syslinux.py F: support/testing/tests/package/sample_python_augeas.py +F: support/testing/tests/package/sample_python_flask.py F: support/testing/tests/package/test_python_augeas.py +F: support/testing/tests/package/test_python_flask.py F: toolchain/ N: Timo Ketola diff --git a/support/testing/tests/package/sample_python_flask.py b/support/testing/tests/package/sample_python_flask.py new file mode 100644 index 0000000000..a7941a94a6 --- /dev/null +++ b/support/testing/tests/package/sample_python_flask.py @@ -0,0 +1,7 @@ +from flask import Flask +app = Flask(__name__) + + +@app.route('/') +def hello_world(): + return 'Hello, World!' diff --git a/support/testing/tests/package/test_python_flask.py b/support/testing/tests/package/test_python_flask.py new file mode 100644 index 0000000000..ef5d96bae9 --- /dev/null +++ b/support/testing/tests/package/test_python_flask.py @@ -0,0 +1,29 @@ +from tests.package.test_python import TestPythonPackageBase +import os +import time + + +class TestPythonPy3Flask(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_FLASK=y + """ + sample_scripts = ["tests/package/sample_python_flask.py"] + timeout = 60 + + def test_run(self): + self.login() + self.check_sample_scripts_exist() + cmd = "FLASK_APP=%s %s -m flask run > /dev/null 2>&1 &" % (os.path.basename(self.sample_scripts[0]), + self.interpreter) + _, exit_code = self.emulator.run(cmd, timeout=self.timeout) + + # Give enough time for the flask server to start up + time.sleep(15) + + cmd = "wget -q -O - http://127.0.0.1:5000/" + output, exit_code = self.emulator.run(cmd, timeout=self.timeout) + self.assertEqual(exit_code, 0) + self.assertEqual(output[0], "Hello, World!") From patchwork Sun Sep 19 12:45:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1529831 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@lists.buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HC6r92ZCvz9sPf for ; Sun, 19 Sep 2021 22:46:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5C683400E7; Sun, 19 Sep 2021 12:46:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D9cwT_QQLLHE; Sun, 19 Sep 2021 12:46:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 243D34023D; Sun, 19 Sep 2021 12:46:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id EFE5D1BF95D for ; Sun, 19 Sep 2021 12:45:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DFE95404EF for ; Sun, 19 Sep 2021 12:45:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aek5diVkhyF1 for ; Sun, 19 Sep 2021 12:45:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp4.osuosl.org (Postfix) with ESMTPS id 57440404E3 for ; Sun, 19 Sep 2021 12:45:27 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id CC54BE0006; Sun, 19 Sep 2021 12:45:23 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 19 Sep 2021 14:45:16 +0200 Message-Id: <20210919124517.524402-4-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> References: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/4] package/python-flask-expects-json: new package X-BeenThere: buildroot@lists.buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeremy Connat , Asaf Kahlon , Thomas Petazzoni , Lionel Flandrin , Ricardo Martincoski Errors-To: buildroot-bounces@lists.buildroot.org Sender: "buildroot" This commit adds a new package called python-flask-expects-json, which also to validate the JSON blurbs submitted to a Flask web application. A runtime test is added as well, making sure that the package minimally works with an example Flask application. The files added by this commit are associated both to Nicolas Carrier and myself in the DEVELOPERS file, as Nicolas is also interested in this package. Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 6 +++ package/Config.in | 1 + package/python-flask-expects-json/Config.in | 9 +++++ .../python-flask-expects-json.hash | 5 +++ .../python-flask-expects-json.mk | 14 +++++++ .../sample_python_flask_expects_json.py | 18 +++++++++ .../package/test_python_flask_expects_json.py | 38 +++++++++++++++++++ 7 files changed, 91 insertions(+) create mode 100644 package/python-flask-expects-json/Config.in create mode 100644 package/python-flask-expects-json/python-flask-expects-json.hash create mode 100644 package/python-flask-expects-json/python-flask-expects-json.mk create mode 100644 support/testing/tests/package/sample_python_flask_expects_json.py create mode 100644 support/testing/tests/package/test_python_flask_expects_json.py diff --git a/DEVELOPERS b/DEVELOPERS index 6ed62450a1..ee5ec1d0ef 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1981,10 +1981,13 @@ N: Nicolas Carrier F: package/bmap-tools/ F: package/php-xdebug/ F: package/python-augeas/ +F: package/python-flask-expects-json/ F: support/testing/tests/package/sample_bmap_tools.sh F: support/testing/tests/package/sample_python_augeas.py +F: support/testing/tests/package/sample_python_flask_expects_json.py F: support/testing/tests/package/test_bmap_tools.py F: support/testing/tests/package/test_python_augeas.py +F: support/testing/tests/package/test_python_flask_expects_json.py N: Nicolas Cavallari F: package/libgit2/ @@ -2681,6 +2684,7 @@ F: package/pkg-generic.mk F: package/python/ F: package/python3/ F: package/python-augeas/ +F: package/python-flask-expects-json/ F: package/python-mad/ F: package/python-serial/ F: package/qextserialport/ @@ -2696,8 +2700,10 @@ F: package/weston/ F: support/testing/tests/boot/test_syslinux.py F: support/testing/tests/package/sample_python_augeas.py F: support/testing/tests/package/sample_python_flask.py +F: support/testing/tests/package/sample_python_flask_expects_json.py F: support/testing/tests/package/test_python_augeas.py F: support/testing/tests/package/test_python_flask.py +F: support/testing/tests/package/test_python_flask_expects_json.py F: toolchain/ N: Timo Ketola diff --git a/package/Config.in b/package/Config.in index 899b493180..0e80611cb6 100644 --- a/package/Config.in +++ b/package/Config.in @@ -999,6 +999,7 @@ menu "External python modules" source "package/python-flask/Config.in" source "package/python-flask-babel/Config.in" source "package/python-flask-cors/Config.in" + source "package/python-flask-expects-json/Config.in" source "package/python-flask-jsonrpc/Config.in" source "package/python-flask-login/Config.in" source "package/python-flask-sqlalchemy/Config.in" diff --git a/package/python-flask-expects-json/Config.in b/package/python-flask-expects-json/Config.in new file mode 100644 index 0000000000..901234762e --- /dev/null +++ b/package/python-flask-expects-json/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_PYTHON_FLASK_EXPECTS_JSON + bool "python-flask-expects-json" + select BR2_PACKAGE_PYTHON_FLASK # runtime + select BR2_PACKAGE_PYTHON_JSONSCHEMA # runtime + help + Decorator for REST endpoints in flask. Validate JSON request + data. + + https://github.com/fischerfredl/flask-expects-json diff --git a/package/python-flask-expects-json/python-flask-expects-json.hash b/package/python-flask-expects-json/python-flask-expects-json.hash new file mode 100644 index 0000000000..d71ddd0592 --- /dev/null +++ b/package/python-flask-expects-json/python-flask-expects-json.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/flask-expects-json/json +md5 c1fb8ede58db312d7923212dc97b8ab4 flask-expects-json-1.5.0.tar.gz +sha256 0087dc3d089f1ac75a1fc0f259f4dbd02bbb9c356e92e1a080f2309e2f75d053 flask-expects-json-1.5.0.tar.gz +# Locally computed sha256 checksums +sha256 06154a99fdc664107294a0a5e7e68f776078d075408dd32bbeaa7340fdd39e73 LICENSE.txt diff --git a/package/python-flask-expects-json/python-flask-expects-json.mk b/package/python-flask-expects-json/python-flask-expects-json.mk new file mode 100644 index 0000000000..487f15d4e5 --- /dev/null +++ b/package/python-flask-expects-json/python-flask-expects-json.mk @@ -0,0 +1,14 @@ +################################################################################ +# +# python-flask-expects-json +# +################################################################################ + +PYTHON_FLASK_EXPECTS_JSON_VERSION = 1.5.0 +PYTHON_FLASK_EXPECTS_JSON_SOURCE = flask-expects-json-$(PYTHON_FLASK_EXPECTS_JSON_VERSION).tar.gz +PYTHON_FLASK_EXPECTS_JSON_SITE = https://files.pythonhosted.org/packages/4c/4a/9d9d050af700fb3feebd1f8466e73d65ce8b4709f27773e07100b0993451 +PYTHON_FLASK_EXPECTS_JSON_SETUP_TYPE = setuptools +PYTHON_FLASK_EXPECTS_JSON_LICENSE = MIT +PYTHON_FLASK_EXPECTS_JSON_LICENSE_FILES = LICENSE.txt + +$(eval $(python-package)) diff --git a/support/testing/tests/package/sample_python_flask_expects_json.py b/support/testing/tests/package/sample_python_flask_expects_json.py new file mode 100644 index 0000000000..d45026dd49 --- /dev/null +++ b/support/testing/tests/package/sample_python_flask_expects_json.py @@ -0,0 +1,18 @@ +from flask import Flask +from flask_expects_json import expects_json +app = Flask(__name__) + +schema = { + 'type': 'object', + 'properties': { + 'name': {'type': 'string'}, + 'email': {'type': 'string'}, + }, + 'required': ['name', 'email'] +} + + +@app.route('/', methods=['POST']) +@expects_json(schema) +def hello_world(): + return 'Hello, World!' diff --git a/support/testing/tests/package/test_python_flask_expects_json.py b/support/testing/tests/package/test_python_flask_expects_json.py new file mode 100644 index 0000000000..b7326f5d9e --- /dev/null +++ b/support/testing/tests/package/test_python_flask_expects_json.py @@ -0,0 +1,38 @@ +from tests.package.test_python import TestPythonPackageBase +import os +import time + + +class TestPythonPy3FlaskExpectsJson(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_LIBCURL=y + BR2_PACKAGE_LIBCURL_CURL=y + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_FLASK=y + BR2_PACKAGE_PYTHON_FLASK_EXPECTS_JSON=y + """ + sample_scripts = ["tests/package/sample_python_flask_expects_json.py"] + timeout = 60 + + def try_json(self, payload, expects): + cmd = """curl -s -o /dev/null -w "%%{http_code}\\n" -X POST """ + cmd += """-H "Content-Type: application/json" -d '%s' http://127.0.0.1:5000""" % payload + output, exit_code = self.emulator.run(cmd, timeout=self.timeout) + self.assertEqual(exit_code, 0) + self.assertEqual(output[-1], str(expects)) + + def test_run(self): + self.login() + self.check_sample_scripts_exist() + cmd = "FLASK_APP=%s %s -m flask run > /dev/null 2>&1 &" % (os.path.basename(self.sample_scripts[0]), + self.interpreter) + _, exit_code = self.emulator.run(cmd, timeout=self.timeout) + + # Give enough time for the flask server to start up + time.sleep(15) + + self.try_json("""{"email": "test", "name": "test"}""", 200) + self.try_json("""{"email": "test", "name": 2}""", 400) + self.try_json("""{"email": "test"}""", 400) From patchwork Sun Sep 19 12:45:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1529830 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@lists.buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HC6qx6LfSz9sPf for ; Sun, 19 Sep 2021 22:46:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 20D7B60773; Sun, 19 Sep 2021 12:46:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1KqOuLoZVDlD; Sun, 19 Sep 2021 12:46:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 624C760765; Sun, 19 Sep 2021 12:46:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D68191BF2F3 for ; Sun, 19 Sep 2021 12:45:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C59BA60729 for ; Sun, 19 Sep 2021 12:45:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sw6rvng1AO7w for ; Sun, 19 Sep 2021 12:45:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by smtp3.osuosl.org (Postfix) with ESMTPS id 7CFC7606AF for ; Sun, 19 Sep 2021 12:45:27 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 420FBC0004; Sun, 19 Sep 2021 12:45:25 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 19 Sep 2021 14:45:17 +0200 Message-Id: <20210919124517.524402-5-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> References: <20210919124517.524402-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 4/4] package/python-git: new package X-BeenThere: buildroot@lists.buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeremy Connat , Asaf Kahlon , Thomas Petazzoni , Ricardo Martincoski Errors-To: buildroot-bounces@lists.buildroot.org Sender: "buildroot" The files added by this commit are associated both to Nicolas Carrier and myself in the DEVELOPERS, as this commit is based on initial work from Nicolas. Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 6 ++++++ package/Config.in | 1 + package/python-git/Config.in | 13 +++++++++++++ package/python-git/python-git.hash | 3 +++ package/python-git/python-git.mk | 13 +++++++++++++ support/testing/tests/package/sample_python_git.py | 1 + support/testing/tests/package/test_python_git.py | 11 +++++++++++ 7 files changed, 48 insertions(+) create mode 100644 package/python-git/Config.in create mode 100644 package/python-git/python-git.hash create mode 100644 package/python-git/python-git.mk create mode 100644 support/testing/tests/package/sample_python_git.py create mode 100644 support/testing/tests/package/test_python_git.py diff --git a/DEVELOPERS b/DEVELOPERS index ee5ec1d0ef..db7521b578 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1982,12 +1982,15 @@ F: package/bmap-tools/ F: package/php-xdebug/ F: package/python-augeas/ F: package/python-flask-expects-json/ +F: package/python-git/ F: support/testing/tests/package/sample_bmap_tools.sh F: support/testing/tests/package/sample_python_augeas.py F: support/testing/tests/package/sample_python_flask_expects_json.py +F: support/testing/tests/package/sample_python_git.py F: support/testing/tests/package/test_bmap_tools.py F: support/testing/tests/package/test_python_augeas.py F: support/testing/tests/package/test_python_flask_expects_json.py +F: support/testing/tests/package/test_python_git.py N: Nicolas Cavallari F: package/libgit2/ @@ -2685,6 +2688,7 @@ F: package/python/ F: package/python3/ F: package/python-augeas/ F: package/python-flask-expects-json/ +F: package/python-git/ F: package/python-mad/ F: package/python-serial/ F: package/qextserialport/ @@ -2701,9 +2705,11 @@ F: support/testing/tests/boot/test_syslinux.py F: support/testing/tests/package/sample_python_augeas.py F: support/testing/tests/package/sample_python_flask.py F: support/testing/tests/package/sample_python_flask_expects_json.py +F: support/testing/tests/package/sample_python_git.py F: support/testing/tests/package/test_python_augeas.py F: support/testing/tests/package/test_python_flask.py F: support/testing/tests/package/test_python_flask_expects_json.py +F: support/testing/tests/package/test_python_git.py F: toolchain/ N: Timo Ketola diff --git a/package/Config.in b/package/Config.in index 0e80611cb6..785ba992e3 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1010,6 +1010,7 @@ menu "External python modules" source "package/python-functools32/Config.in" source "package/python-future/Config.in" source "package/python-futures/Config.in" + source "package/python-git/Config.in" source "package/python-gitdb2/Config.in" source "package/python-gobject/Config.in" source "package/python-gpiozero/Config.in" diff --git a/package/python-git/Config.in b/package/python-git/Config.in new file mode 100644 index 0000000000..b8dbc3a6c1 --- /dev/null +++ b/package/python-git/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_PYTHON_GIT + bool "python-git" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_USE_MMU # git + select BR2_PACKAGE_GIT # runtime + select BR2_PACKAGE_PYTHON_GITDB2 # runtime + select BR2_PACKAGE_PYTHON_TYPING_EXTENSIONS # runtime + help + GitPython is a python library used to interact with git + repositories, high-level like git-porcelain, or low-level + like git-plumbing. + + https://github.com/gitpython-developers/GitPython diff --git a/package/python-git/python-git.hash b/package/python-git/python-git.hash new file mode 100644 index 0000000000..5a75bc3592 --- /dev/null +++ b/package/python-git/python-git.hash @@ -0,0 +1,3 @@ +# locally computed hashes +sha256 78baf9fc223536e38a6e0d9241536fedaecf79bc000b3a05962257d83571fc5d python-git-3.1.20.tar.gz +sha256 fd657ffc2cef63d25c78cab7808d414dd03a282e63893491fd11c32f98be67fb LICENSE diff --git a/package/python-git/python-git.mk b/package/python-git/python-git.mk new file mode 100644 index 0000000000..0e158434fd --- /dev/null +++ b/package/python-git/python-git.mk @@ -0,0 +1,13 @@ +################################################################################ +# +# python-git +# +################################################################################ + +PYTHON_GIT_VERSION = 3.1.20 +PYTHON_GIT_SITE = $(call github,gitpython-developers,GitPython,$(PYTHON_GIT_VERSION)) +PYTHON_GIT_LICENSE = BSD-3-Clause +PYTHON_GIT_LICENSE_FILES = LICENSE +PYTHON_GIT_SETUP_TYPE = setuptools + +$(eval $(python-package)) diff --git a/support/testing/tests/package/sample_python_git.py b/support/testing/tests/package/sample_python_git.py new file mode 100644 index 0000000000..fa9ff23039 --- /dev/null +++ b/support/testing/tests/package/sample_python_git.py @@ -0,0 +1 @@ +from git import * # noqa diff --git a/support/testing/tests/package/test_python_git.py b/support/testing/tests/package/test_python_git.py new file mode 100644 index 0000000000..4d5489e974 --- /dev/null +++ b/support/testing/tests/package/test_python_git.py @@ -0,0 +1,11 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Git(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_GIT=y + """ + sample_scripts = ["tests/package/sample_python_git.py"]