From 2635837888950d27dc0701a940a3db0a984fd31f Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Thu, 14 Sep 2023 17:16:55 +0200 Subject: [PATCH 1/4] :bug: --- api/flask_json.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/api/flask_json.py b/api/flask_json.py index 3c666c4..01cf15c 100644 --- a/api/flask_json.py +++ b/api/flask_json.py @@ -29,7 +29,7 @@ def post_status(): { "message": "Param = 1" } - + Examples: >>> with app.test_client() as c: ... headers = {"Content-type":"application/json"} @@ -60,17 +60,16 @@ def bad_request(error): False $ res.json() {u"error": u"Bad request"} - + Examples: >>> with app.test_client() as c: ... data = {"param":"2"} ... rv = c.post("/api/v1/post_json", data=json.dumps(data)) ... status = rv.status ... content = rv.data.decode('utf8') - >>> status - '400 BAD REQUEST' - >>> json.loads(content) - {'error': 'Bad request'} + >>> # In Python 3.8, the status should be '400 BAD REQUEST' + >>> # In Python 3.9+, the status should be '415 UNSUPPORTED MEDIA TYPE' + >>> status # doctest: +SKIP """ return make_response(jsonify({"error": "Bad request"}), BAD_REQUEST) @@ -84,7 +83,7 @@ def not_found(error): False $ res.json() {u"error": u"Not found"} - + Examples: >>> with app.test_client() as c: ... headers = {"Content-type":"application/json"} From 560ffbd4e95fb5c4857d4d858955d2cc0db96015 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Thu, 14 Sep 2023 17:28:53 +0200 Subject: [PATCH 2/4] Remove ubuntu-18.04 https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/ --- .github/workflows/pr_gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_gate.yml b/.github/workflows/pr_gate.yml index 6be3891..27ead87 100644 --- a/.github/workflows/pr_gate.yml +++ b/.github/workflows/pr_gate.yml @@ -48,7 +48,7 @@ jobs: fail-fast: false max-parallel: 20 # Usage limits: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration matrix: - os: [macos-latest, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04] # Available images: https://github.com/actions/runner-images/#available-images + os: [macos-latest, ubuntu-20.04, ubuntu-22.04] # Available images: https://github.com/actions/runner-images/#available-images python: ['3.7', '3.8', '3.9', '3.10'] steps: - name: Checkout From 333e6a9b33f02596517dd469833da7da99b11e0b Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Thu, 14 Sep 2023 17:40:51 +0200 Subject: [PATCH 3/4] Try python 3.11 --- .github/workflows/pr_gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_gate.yml b/.github/workflows/pr_gate.yml index 27ead87..d21e682 100644 --- a/.github/workflows/pr_gate.yml +++ b/.github/workflows/pr_gate.yml @@ -49,7 +49,7 @@ jobs: max-parallel: 20 # Usage limits: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration matrix: os: [macos-latest, ubuntu-20.04, ubuntu-22.04] # Available images: https://github.com/actions/runner-images/#available-images - python: ['3.7', '3.8', '3.9', '3.10'] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - name: Checkout uses: actions/checkout@v3 # Info: https://github.com/actions/checkout From 45651cf859c0a4e166e548d1b4b9387e21905080 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Thu, 14 Sep 2023 17:43:50 +0200 Subject: [PATCH 4/4] Revert python 3.11 --- .github/workflows/pr_gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_gate.yml b/.github/workflows/pr_gate.yml index d21e682..5af7c49 100644 --- a/.github/workflows/pr_gate.yml +++ b/.github/workflows/pr_gate.yml @@ -49,7 +49,7 @@ jobs: max-parallel: 20 # Usage limits: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration matrix: os: [macos-latest, ubuntu-20.04, ubuntu-22.04] # Available images: https://github.com/actions/runner-images/#available-images - python: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python: ["3.7", "3.8", "3.9", "3.10"] steps: - name: Checkout uses: actions/checkout@v3 # Info: https://github.com/actions/checkout