diff --git a/CHANGES.rst b/CHANGES.rst index d7ffaab5..37c54f97 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,13 @@ +Version 3.0.2 +------------- + +Released 2024-02-03 + +- Correct type for ``jinja_loader`` property. :issue:`5388` +- Fix error with ``--extra-files`` and ``--exclude-patterns`` CLI options. + :issue:`5391` + + Version 3.0.1 ------------- diff --git a/pyproject.toml b/pyproject.toml index 4983b6ff..3fefae18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "Flask" -version = "3.0.1" +version = "3.0.2" description = "A simple framework for building complex web applications." readme = "README.rst" license = {file = "LICENSE.rst"} diff --git a/src/flask/cli.py b/src/flask/cli.py index ffdcb182..d4df2802 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -858,7 +858,9 @@ class SeparatedPathType(click.Path): self, value: t.Any, param: click.Parameter | None, ctx: click.Context | None ) -> t.Any: items = self.split_envvar_value(value) - return [super().convert(item, param, ctx) for item in items] + # can't call no-arg super() inside list comprehension until Python 3.12 + super_convert = super().convert + return [super_convert(item, param, ctx) for item in items] @click.command("run", short_help="Run a development server.") diff --git a/src/flask/sansio/scaffold.py b/src/flask/sansio/scaffold.py index 40534f53..53557008 100644 --- a/src/flask/sansio/scaffold.py +++ b/src/flask/sansio/scaffold.py @@ -9,6 +9,7 @@ from collections import defaultdict from functools import update_wrapper import click +from jinja2 import BaseLoader from jinja2 import FileSystemLoader from werkzeug.exceptions import default_exceptions from werkzeug.exceptions import HTTPException @@ -272,7 +273,7 @@ class Scaffold: self._static_url_path = value @cached_property - def jinja_loader(self) -> FileSystemLoader | None: + def jinja_loader(self) -> BaseLoader | None: """The Jinja loader for this object's templates. By default this is a class :class:`jinja2.loaders.FileSystemLoader` to :attr:`template_folder` if it is set. diff --git a/tests/test_cli.py b/tests/test_cli.py index 79de1fc8..09995488 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -679,3 +679,8 @@ def test_cli_empty(app): result = app.test_cli_runner().invoke(args=["blue", "--help"]) assert result.exit_code == 2, f"Unexpected success:\n\n{result.output}" + + +def test_run_exclude_patterns(): + ctx = run_command.make_context("run", ["--exclude-patterns", __file__]) + assert ctx.params["exclude_patterns"] == [__file__]