-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Upgrade to Flask 2 #434
Upgrade to Flask 2 #434
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
93678d9
to
01c03d3
Compare
e259d47
to
0d28436
Compare
PyType seems fundamentally incompatible with sqlalchemy, at least so far. It tries to interpret references to properties like if len(mod.description) < 100:
To proceed with adding PyType, we'll either need a smarter version of PyType or an update to sqlalchemy that somehow provides annotations of how its objects' properties can actually be used. I will now remove PyType from this PR. |
0d28436
to
20281dd
Compare
20281dd
to
d2485b0
Compare
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.
Everything appears to be working fine now, so let's give it a try!
Problem
After #440 was merged, alpha is no longer working (despite working fine in localhost testing).
Cause
@DasSkelett says this is caused by pallets/markupsafe#282, which says "You are using an unsupported version of Jinja," meaning that we should use the latest version of Jinja.
Background
In #353 we pinned the Flask and Jinja2 dependency versions because there are API changes that would break parts of the backend and more testing is required.
Backend logs (including deprecation warnings) can be printed with:
Motivation
See python/typeshed#5423, the type stubs for Flask and Jinja2 may be removed from typeshed soon because the latest versions of those modules have type hints built-in. I'm not certain, but I think this means we might wake up one day to find that our code using the older versions no longer passes the
mypy
tests.Changes
Now we install the latest versions of Flask and Jinja2, and various deprecation warnings are fixed:
sqlalchemy.ext.declarative.declarative_base
imports are changed tosqlalchemy.orm.declarative_base
markdown.util.etree
imports are changed toxml.etree.ElementTree
URL()
is replaced byURL.create()
profile-dir
config setting for tests so the test harness doesn't try to create dirs it can't accessflask_api.status
imports are changed tohttp.HTTPStatus
Since integral type hints for Jinja2 should mean thatChainableUndefined
is defined properly, the PyType test harness we removed from Handle missing default mod version, don't close db before rendering templates #378 is back to provide some extra checks on our code (this is currently in flux, the test just failed as I'm typing this but I'm going to try to massage it into working after creating the PR)PyType still doesn't work, see comments below for details.
As far as I can tell, everything still works.