Skip to content

Commit e655099

Browse files
authored
fix(requirements-asynqp): Update flask to latest stable (#347)
* fix(requirements-asynqp): Update flask to latest stable * This issue is described in pallets/markupsafe#284 * The recommended action is to upgrade Jinja2, pallets/markupsafe#284 (comment) but that only works with newer flask, so hence the flask upgrade. * The exact backtrace in our case, that we are trying to avoid here is this: ``` Traceback: /usr/local/lib/python3.7/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/clients/test_asynqp.py:16: in <module> import tests.apps.flask_app tests/apps/flask_app/__init__.py:5: in <module> from .app import flask_server as server tests/apps/flask_app/app.py:10: in <module> from flask import jsonify, Response venv/lib/python3.7/site-packages/flask/__init__.py:14: in <module> from jinja2 import escape venv/lib/python3.7/site-packages/jinja2/__init__.py:12: in <module> from .environment import Environment venv/lib/python3.7/site-packages/jinja2/environment.py:25: in <module> from .defaults import BLOCK_END_STRING venv/lib/python3.7/site-packages/jinja2/defaults.py:3: in <module> from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 venv/lib/python3.7/site-packages/jinja2/filters.py:13: in <module> from markupsafe import soft_unicode E ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/circleci/repo/venv/lib/python3.7/site-packages/markupsafe/__init__.py) ``` * feat(ci): Add test job for legacy flask/Jinja2/markupsafe versions
1 parent 5a822b6 commit e655099

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

.circleci/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,26 @@ jobs:
255255
pip uninstall -y uvloop
256256
pytest -v tests/clients/test_asynqp.py
257257
258+
py37asynqp-legacy:
259+
docker:
260+
- image: circleci/python:3.7.9
261+
- image: rabbitmq:3.5.4
262+
working_directory: ~/repo
263+
steps:
264+
- checkout
265+
- pip-install-deps:
266+
requirements: "tests/requirements-asynqp-legacy-flask-markupsafe.txt"
267+
- run:
268+
name: run tests
269+
environment:
270+
INSTANA_TEST: "true"
271+
ASYNQP_TEST: "true"
272+
command: |
273+
. venv/bin/activate
274+
# We uninstall uvloop as it interferes with asyncio changing the event loop policy
275+
pip uninstall -y uvloop
276+
pytest -v tests/clients/test_asynqp.py
277+
258278
gevent38:
259279
docker:
260280
- image: circleci/python:3.8.5
@@ -283,4 +303,5 @@ workflows:
283303
- py27cassandra
284304
- py36cassandra
285305
- py37asynqp
306+
- py37asynqp-legacy
286307
- gevent38
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://github.com/pallets/markupsafe/issues/284
2+
# Some of our customers still use legacy flask.
3+
# The latest `markupsafe` can't be used with
4+
# the required Jinja2 version of the required flask<2.0.0 version
5+
# so we have to pin down markupsafe to the last version
6+
# which still worked.
7+
8+
aiohttp>=3.7.4
9+
asynqp>=0.6
10+
flask>=1.1.4,<2.0.0
11+
Jinja2<3.0.0
12+
markupsafe==2.0.1
13+
mock>=2.0.0
14+
nose>=1.0
15+
pytest>=4.6
16+
urllib3[secure]!=1.25.0,!=1.25.1,<1.27,>=1.21.1

tests/requirements-asynqp.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
aiohttp>=3.7.4
22
asynqp>=0.6
3-
flask>=1.1.4,<2.0.0
3+
flask>=2.0.0,<3.0.0
44
mock>=2.0.0
55
nose>=1.0
66
pytest>=4.6
7-
urllib3[secure]!=1.25.0,!=1.25.1,<1.27,>=1.21.1
7+
urllib3[secure]!=1.25.0,!=1.25.1,<1.27,>=1.21.1

0 commit comments

Comments
 (0)