Commit Graph

616 Commits

Author SHA1 Message Date
David Lord 8646edca6f
set `Vary: Cookie` header consistently for session 2023-05-02 07:14:15 -07:00
David Lord 04c21387db
update test cookie handling for Werkzeug 2.3 2023-04-12 10:55:00 -07: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 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
David Lord 3ba37d2afe
fix uninstalled package tests under tox 2022-06-06 08:24:05 -07:00
Evgeny Prigorodov 88bcf78439
instance_path for namespace packages uses path closest to submodule 2022-06-06 08:16:00 -07:00
David Lord 3351a8677e
add errorhandler type check tests 2022-06-05 15:44:28 -07:00
David Lord 81be290ec8
view function is actually type checked 2022-06-05 15:43:53 -07:00
lecovi 8c6f1d96de
add example code for testing typing tools 2022-06-01 11:34:51 -07:00
Stanislav Bushuev 3ecebcdf8d Add test config.from_mapping method: ignoring items with non-upper keys 2022-05-31 17:51:39 +02:00
David Lord 1888df3440
Merge remote-tracking branch 'origin/2.1.x' 2022-05-23 10:08:52 -07:00
David Lord 1232d69860
inline conditional imports for cli behaviors 2022-05-23 09:46:20 -07:00
David Lord e044b00047
avoid triggering setupmethod late in tests 2022-05-23 09:09:12 -07:00
David Lord 39f9363296
finish moving url_for to app
move entire implementation to app
make special build args actual keyword-only args
handle no app context in method
mention other config in server_name error
implicit external with scheme
use adapter.build url_scheme argument
rewrite documentation
2022-05-14 12:46:01 -07:00
dzcode eb5dd9f5ef
add aborter object to app 2022-05-12 13:29:54 -07:00
Tim Hoagland fdab801fbb
add redirect method to app 2022-05-10 11:02:24 -07:00
Qingpeng Li 1e5dd43022
refactor error checks in register_error_handler
Co-authored-by: David Lord <davidism@gmail.com>
2022-05-03 11:52:11 -06:00
David Lord ef6c2b9e4a
clean up pytest.raises tests 2022-04-28 09:32:31 -07:00
James Warne 5050a18a00
evaluate --cert before --key 2022-04-24 10:01:40 -07:00
David Lord 411dbb37e2
remove old test 2022-04-11 06:11:37 -07:00
David Lord e75d575361
windows env vars are uppercase 2022-03-25 12:07:45 -07:00
David Lord 4eb5e9455b
more from_prefixed_env features
* support nested dict access with "__" separator
* don't specify separator in prefix
* catch exceptions for any loads function
2022-03-25 11:54:45 -07:00
pgjones 08a283af5e
Allow loading of environment variables into the config
This new method will pick out any environment variables with a certain
prefix and place them into the config named without the prefix. This
makes it easy to use environment variables to configure the app as is
now more popular than when Flask started.

The prefix should ensure that the environment isn't polluted and the
config isn't polluted by environment variables.

I've followed the dynaconf convention of trying to parse the
environment variable and then falling back to the raw value if parsing
fails.
2022-03-25 11:54:03 -07:00
David Lord 81c7ff7f8d
update tests for relative redirects 2022-03-25 11:48:26 -07:00