Commit graph

636 commits

Author SHA1 Message Date
pgjones
d8262aa58c Pass the request ctx rather than use the globals in the app
The globals have a performance penalty which can be justified for the
convinience in user code. In the app however the ctx can easily be
passed through the method calls thereby reducing the performance
penalty.

This may affect extensions if they have subclassed the app and
overridden these methods.
2023-08-27 10:18:08 +01:00
David Lord
5bb30270d2
bump werkzeug 2.3.7
use importlib.metadata.version
2023-08-21 09:39:10 -07:00
David Lord
826514b8eb
fix flake8 bugbear findings 2023-08-16 13:37:56 -07:00
David Lord
0a00e1b608
use tmp_path instead of tmpdir 2023-05-02 10:38:27 -07:00
David Lord
1d7281fe07
remove egg test
eggs aren't supported, and Python 3.12 removes setuptools
2023-05-02 09:53:31 -07:00
David Lord
8705dd39c4
set Vary: Cookie header consistently for session 2023-05-01 08:10:52 -07:00
David Lord
2e8fe7b2f2
drop support for python 3.7 2023-04-20 11:09:55 -07:00
David Lord
84c007d34f
show subdomain or host in routes output 2023-04-14 09:43:00 -07:00
David Lord
9cb1a7a52d
blinker is required, signals are always available 2023-04-13 07:39:24 -07:00
David Lord
c24f8c8199
no cookie domain by default 2023-04-12 12:38:22 -07:00
David Lord
fa0ceb62f2
Merge branch '2.2.x' 2023-04-12 10:57:53 -07:00
David Lord
04c21387db
update test cookie handling for Werkzeug 2.3 2023-04-12 10:55:00 -07:00
Evgeny Mozhaev
b8b410014d
require a non-empty name for blueprints 2023-03-11 08:26:36 -08:00
AntoineMath
b10b6d4af1
add text parameter to config.from_file 2023-02-23 11:10:21 -08:00
David Lord
2a33c17854
deprecate got_first_request property 2023-02-23 09:28:42 -08:00
David Lord
9c02f07f9b
deprecate markupsafe exports 2023-02-23 08:55:01 -08:00
David Lord
6650764e97
remove previously deprecated code 2023-02-23 08:35:16 -08:00
David Lord
4ddb3f73ba
Merge branch '2.2.x' 2023-02-07 07:18:54 -08:00
pre-commit-ci[bot]
a15da89dbb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-07 04:43:02 +00:00
David Lord
99b34f7148
move and update flake8 config 2023-01-20 13:42:50 -08:00
David Lord
3a35977d5f
stop ignoring flake8 e402 2023-01-19 06:35:15 -08:00
David Lord
261e4a6cf2
fix flake8 bugbear errors 2023-01-18 10:32:51 -08:00
pgjones
cabda59353 Ensure that blueprint subdomains suffix-chain
This ensures that a child's subdomain prefixs any parent subdomain
such that the full domain is child.parent.domain.tld and onwards with
further nesting. This makes the most sense to users and mimics how
url_prefixes work (although subdomains suffix).
2023-01-04 18:06:04 +00:00
Josh Michael Karamuth
d7b6c1f670 Fix subdomain inheritance for nested blueprints.
Fixes #4834
2023-01-04 16:19:52 +00:00
David Lord
d178653b5f
update requirements 2022-11-25 07:39:54 -08:00
David Lord
bfdd37110c
deprecate config attributes 2022-08-01 16:58:55 -07:00
David Lord
ef95998d79
deprecate FLASK_ENV 2022-08-01 15:11:21 -07:00
David Lord
5d8e35653f
refactor lazy loading
Remove the `--eager-loading/--lazy-loading` options and the
`DispatchingApp` middleware. The `run` command handles loading
exceptions directly. The reloader always prints out tracebacks
immediately and always defers raising the error.
2022-08-01 10:34:13 -07:00
Matthijs van der Vleuten
4bf7415a96
allow TypedDict as a response value 2022-07-14 14:15:05 -07:00
David Lord
69f9845ef2
add json provider interface 2022-07-13 07:42:52 -07:00
pgjones
91044c4d76 Change _cv_req -> _cv_request
This is a clearer name for the variable.
2022-07-09 13:41:35 +01:00
David Lord
82c2e0366c
remove uses of LocalStack 2022-07-08 11:13:09 -07:00
pgjones
2f1d1d6256 Add further typing tests
This should help ensure the app decorators are correctly typed.
2022-07-08 14:33:20 +01:00
Phil Jones
9b44bf2818
Improve decorator typing (#4676)
* Add a missing setupmethod decorator

* Improve the decorator typing

This will allow type checkers to understand that the decorators return
the same function signature as passed as an argument. This follows the
guidelines from
https://mypy.readthedocs.io/en/stable/generics.html#declaring-decorators.

I've chosen to keep a TypeVar per module and usage as I think
encouraged by PEP 695, which I hope is accepted as the syntax is much
nicer.
2022-07-06 14:05:20 -07:00
David Lord
60b845ebab
update typing tests for json 2022-07-02 21:41:37 -07:00
Grey Li
ca2bfbb0ac
Support returning list as JSON 2022-07-02 21:41:32 -07:00
David Lord
1626aff602
Merge branch '2.1.x' 2022-07-02 21:03:09 -07:00
David Lord
ab6a8b0330
relax routes cli match order 2022-07-02 21:02:00 -07:00
David Lord
84c722044a
new debug/test preserve context implementation 2022-07-01 12:01:44 -07:00
David Lord
5544d09477
re-add flag to skip unguarded app.run from CLI 2022-06-29 21:19:28 -07:00
pgjones
46433e9807
add generate_template and generate_template_string functions 2022-06-18 12:20:53 -07:00
pgjones
762382e436
view functions can return generators as responses directly 2022-06-18 11:25:05 -07:00
Kevin Kirsche
ed42e92928
session expiration datetime is UTC timezone-aware 2022-06-17 12:01:48 -07:00
David Lord
c9e000b9ce
with_appcontext lasts for the lifetime of the click context 2022-06-17 11:52:01 -07:00
David Lord
ab1fbef29a
prefer --app over FLASK_APP in docs 2022-06-17 09:26:26 -07:00
David Lord
aa801c431a
FlaskGroup can be nested 2022-06-15 14:09:56 -07:00
David Lord
6e23239567
add View.init_every_request attribute 2022-06-06 15:11:01 -07:00
David Lord
96c97dec09
deprecate before_first_request 2022-06-06 10:04:05 -07:00
David Lord
7a2d5fb6df
Merge branch '2.1.x' 2022-06-06 09:30:30 -07:00
David Lord
b06df0a792
remove outdated instance path test 2022-06-06 09:17:53 -07:00