* [Buildroot] [PATCH 1/4] package/python-{smmap2, gitdb2}: bump versions to 4.0.0 and 4.0.7
2021-09-19 12:45 [Buildroot] [PATCH 0/4] Misc Python package updates/additions Thomas Petazzoni
@ 2021-09-19 12:45 ` Thomas Petazzoni
2021-09-19 12:45 ` [Buildroot] [PATCH 2/4] support/testing/tests/package/test_python_flask: new test Thomas Petazzoni
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2021-09-19 12:45 UTC (permalink / raw)
To: Buildroot List
Cc: Jeremy Connat, Asaf Kahlon, Thomas Petazzoni, Ricardo Martincoski
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 <thomas.petazzoni@bootlin.com>
---
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 + \
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 2/4] support/testing/tests/package/test_python_flask: new test
2021-09-19 12:45 [Buildroot] [PATCH 0/4] Misc Python package updates/additions Thomas Petazzoni
2021-09-19 12:45 ` [Buildroot] [PATCH 1/4] package/python-{smmap2, gitdb2}: bump versions to 4.0.0 and 4.0.7 Thomas Petazzoni
@ 2021-09-19 12:45 ` Thomas Petazzoni
2021-09-19 12:45 ` [Buildroot] [PATCH 3/4] package/python-flask-expects-json: new package Thomas Petazzoni
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2021-09-19 12:45 UTC (permalink / raw)
To: Buildroot List
Cc: Lionel Flandrin, Thomas Petazzoni, Jeremy Connat, Ricardo Martincoski
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 <thomas.petazzoni@bootlin.com>
---
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 <lionel.orry@gmail.com>
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 <timo.ketola@exertus.fi>
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!")
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 3/4] package/python-flask-expects-json: new package
2021-09-19 12:45 [Buildroot] [PATCH 0/4] Misc Python package updates/additions Thomas Petazzoni
2021-09-19 12:45 ` [Buildroot] [PATCH 1/4] package/python-{smmap2, gitdb2}: bump versions to 4.0.0 and 4.0.7 Thomas Petazzoni
2021-09-19 12:45 ` [Buildroot] [PATCH 2/4] support/testing/tests/package/test_python_flask: new test Thomas Petazzoni
@ 2021-09-19 12:45 ` Thomas Petazzoni
2021-09-23 20:09 ` Arnout Vandecappelle
2021-09-19 12:45 ` [Buildroot] [PATCH 4/4] package/python-git: " Thomas Petazzoni
2021-09-23 20:08 ` [Buildroot] [PATCH 0/4] Misc Python package updates/additions Arnout Vandecappelle
4 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2021-09-19 12:45 UTC (permalink / raw)
To: Buildroot List
Cc: Jeremy Connat, Asaf Kahlon, Thomas Petazzoni, Lionel Flandrin,
Ricardo Martincoski
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 <thomas.petazzoni@bootlin.com>
---
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 <nicolas.carrier@orolia.com>
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 <nicolas.cavallari@green-communications.fr>
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 <timo.ketola@exertus.fi>
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)
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH 3/4] package/python-flask-expects-json: new package
2021-09-19 12:45 ` [Buildroot] [PATCH 3/4] package/python-flask-expects-json: new package Thomas Petazzoni
@ 2021-09-23 20:09 ` Arnout Vandecappelle
0 siblings, 0 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2021-09-23 20:09 UTC (permalink / raw)
To: Thomas Petazzoni, Buildroot List
Cc: Lionel Flandrin, Asaf Kahlon, Jeremy Connat, Ricardo Martincoski
On 19/09/2021 14:45, Thomas Petazzoni wrote:
> 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 <thomas.petazzoni@bootlin.com>
[snip]
> 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
It's not enforced by check-package (yet), but we're converging on two spaces
separation in the hash file. So I changed that.
It's also "wrong" in the python-smmap2 and gitdb2 hash files, but there it was
already the case so I didn't fix it.
Regards,
Arnout
> 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)
>
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 4/4] package/python-git: new package
2021-09-19 12:45 [Buildroot] [PATCH 0/4] Misc Python package updates/additions Thomas Petazzoni
` (2 preceding siblings ...)
2021-09-19 12:45 ` [Buildroot] [PATCH 3/4] package/python-flask-expects-json: new package Thomas Petazzoni
@ 2021-09-19 12:45 ` Thomas Petazzoni
2021-09-23 20:08 ` [Buildroot] [PATCH 0/4] Misc Python package updates/additions Arnout Vandecappelle
4 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2021-09-19 12:45 UTC (permalink / raw)
To: Buildroot List
Cc: Jeremy Connat, Asaf Kahlon, Thomas Petazzoni, Ricardo Martincoski
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 <thomas.petazzoni@bootlin.com>
---
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 <nicolas.cavallari@green-communications.fr>
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 <timo.ketola@exertus.fi>
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"]
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH 0/4] Misc Python package updates/additions
2021-09-19 12:45 [Buildroot] [PATCH 0/4] Misc Python package updates/additions Thomas Petazzoni
` (3 preceding siblings ...)
2021-09-19 12:45 ` [Buildroot] [PATCH 4/4] package/python-git: " Thomas Petazzoni
@ 2021-09-23 20:08 ` Arnout Vandecappelle
4 siblings, 0 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2021-09-23 20:08 UTC (permalink / raw)
To: Thomas Petazzoni, Buildroot List; +Cc: Jeremy Connat
On 19/09/2021 14:45, Thomas Petazzoni wrote:
> Hello,
>
> A small patch series that:
>
> - Updates python-smmap2 and python-gitdb2 to newer versions (must be
> done in lockstep)
>
> - Adds a python-flask test
>
> - Adds a python-flask-expects-json package, and its associated test.
>
> - Adds a python-git package, and its associated test
>
> Best regards,
>
> Thomas Petazzoni
>
> Thomas Petazzoni (4):
> package/python-{smmap2,gitdb2}: bump versions to 4.0.0 and 4.0.7
> support/testing/tests/package/test_python_flask: new test
> package/python-flask-expects-json: new package
> package/python-git: new package
>
> DEVELOPERS | 16 ++++++++
Since you added stuff to Nicolas' DEVELOPERS entry, it would have been nice to
put him in Cc...
Series applied to master, thanks. One changes in patches 3 and 4 which I'll
comment on there.
Regards,
Arnout
> package/Config.in | 2 +
> package/python-flask-expects-json/Config.in | 9 +++++
> .../python-flask-expects-json.hash | 5 +++
> .../python-flask-expects-json.mk | 14 +++++++
> package/python-git/Config.in | 13 +++++++
> package/python-git/python-git.hash | 3 ++
> package/python-git/python-git.mk | 13 +++++++
> 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 +--
> .../tests/package/sample_python_flask.py | 7 ++++
> .../sample_python_flask_expects_json.py | 18 +++++++++
> .../tests/package/sample_python_git.py | 1 +
> .../tests/package/test_python_flask.py | 29 ++++++++++++++
> .../package/test_python_flask_expects_json.py | 38 +++++++++++++++++++
> .../testing/tests/package/test_python_git.py | 11 ++++++
> .../tests/package/test_python_gitdb2.py | 10 -----
> .../tests/package/test_python_smmap2.py | 10 -----
> 22 files changed, 194 insertions(+), 34 deletions(-)
> 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 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_flask.py
> create mode 100644 support/testing/tests/package/sample_python_flask_expects_json.py
> create mode 100644 support/testing/tests/package/sample_python_git.py
> create mode 100644 support/testing/tests/package/test_python_flask.py
> create mode 100644 support/testing/tests/package/test_python_flask_expects_json.py
> create mode 100644 support/testing/tests/package/test_python_git.py
>
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread