-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loosen flask version requirement to >= 2 #479
Conversation
Later versions in the Flask 2.x series changed the API a fair bit. Loosen the version requirement to >= 2, which allows people to continue using 2.0.x and 2.1.x. Add tests using 2.0.3 to be sure this continues working. Fixes apiflask#478.
f708b72
to
059004b
Compare
059004b
to
127c341
Compare
There's a fair number of unit test failures because the examples depend on more recent features in flask-sqlalchemy (get_or_404, paginate). I could fix them, but I'd like to wait for guidance from @greyli before continuing. |
Please create a separate requirement file for minimal dep versions, see this file for example. |
@greyli Ok I think this is ready for review! Appreciate your support and encouragement on this |
requirements/flask20.in
Outdated
@@ -0,0 +1,5 @@ | |||
authlib==1.2.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of the flask20 test is to test the minimum versions of the install requirements, so this file should include the following definition:
# minimum install requirements
flask==2.0.0
flask-marshmallow==0.12.0
webargs==8.3.0
flask-httpauth==4.0.0
apispec==6.0.0
# for example applications
flask-sqlalchemy==2.5.1
sqlalchemy==1.4.49
marshmallow-dataclass==8.5.0
authlib==1.2.1
And the name min
(for test env, requirement file, etc.) would be more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I think I'll use the name min-versions
since min
might be confused with the existing minimal
@@ -86,6 +87,8 @@ def test_auto_tag_from_blueprint(app, client): | |||
assert {'name': 'Foo'} in rv.json['tags'] | |||
|
|||
|
|||
@pytest.mark.skipif(flask.__version__ < '2.0.1', | |||
reason='Depends on new behaviour introduced in Flask 2.0.1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to add these skips as well if we're going to test with actual flask 2.0.0
@greyli ready for another look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merged, thanks! I'll make a new release soon. |
Later versions in the Flask 2.x series changed the API a fair bit.
Loosen the version requirement to >= 2, which allows people to continue
using 2.0.x and 2.1.x. Add tests using 2.0.3 to be sure this continues
working. Fixes #478.