-
Notifications
You must be signed in to change notification settings - Fork 17
Add Flask 2 support #186
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
Add Flask 2 support #186
Conversation
f"{{{p}}}" if c else p | ||
for c, _, p in parse_rule(request.url_rule.rule) | ||
] | ||
# Transform request.url to the expected normalized-path form. For example, |
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.
@dividedmind LMK if this doesn't satisfy your concerns about this change.
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.
Thanks, looks ok if a bit convoluted :) I'll propose a simpler and perhaps easier to read implementation
f"{{{p}}}" if c else p | ||
for c, _, p in parse_rule(request.url_rule.rule) | ||
] | ||
# Transform request.url to the expected normalized-path form. For example, |
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.
Thanks, looks ok if a bit convoluted :) I'll propose a simpler and perhaps easier to read implementation
Instead of relying on an internal Flask API to parse a Rule, parse the result of calling repr on it. The format of the string returned by repr is the same for Flask 1 and Flask 2, and has all the information we need.
Remove Flask 1 dependency from pyproject.toml. Instead, add a flask1 factor to tox.ini, and use it for testing Flask 1.
Fix up Flask support so it's compatible with v2. Also fixes initial configuration, so a Flask app will be recorded by default.
Import appmap.django at startup, to make sure our middleware gets injected.
c474ff9
to
f15e591
Compare
Fixes getappmap/board/#148.