diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79b632ae..38459fc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: autoupdate_schedule: monthly repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.3.2 + rev: v3.4.0 hooks: - id: pyupgrade args: ["--py38-plus"] @@ -26,7 +26,7 @@ repos: - flake8-bugbear - flake8-implicit-str-concat - repo: https://github.com/peterdemin/pip-compile-multi - rev: v2.6.2 + rev: v2.6.3 hooks: - id: pip-compile-multi-verify - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/docs/config.rst b/docs/config.rst index 3c06b29c..7828fb92 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -410,8 +410,8 @@ from a TOML file: .. code-block:: python - import toml - app.config.from_file("config.toml", load=toml.load) + import tomllib + app.config.from_file("config.toml", load=tomllib.load, text=False) Or from a JSON file: diff --git a/docs/patterns/javascript.rst b/docs/patterns/javascript.rst index 4b1d7e0f..c9c4b0c8 100644 --- a/docs/patterns/javascript.rst +++ b/docs/patterns/javascript.rst @@ -125,8 +125,8 @@ in a Flask view. .. code-block:: javascript let data = new FormData() - data.append("name": "Flask Room") - data.append("description": "Talk about Flask here.") + data.append("name", "Flask Room") + data.append("description", "Talk about Flask here.") fetch(room_url, { "method": "POST", "body": data, diff --git a/pyproject.toml b/pyproject.toml index 400ed59f..1fae1bcb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ description = "A simple framework for building complex web applications." readme = "README.rst" license = {text = "BSD-3-Clause"} maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}] -authors = [{name = "Armin Ronacher", email = "armin.ronacher@active-4.com"}] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", diff --git a/requirements/dev.txt b/requirements/dev.txt index 5e5bc43b..99a6f034 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -10,7 +10,7 @@ -r typing.txt build==0.10.0 # via pip-tools -cachetools==5.3.0 +cachetools==5.3.1 # via tox cfgv==3.3.1 # via pre-commit @@ -28,19 +28,19 @@ filelock==3.12.0 # via # tox # virtualenv -identify==2.5.23 +identify==2.5.24 # via pre-commit -nodeenv==1.7.0 +nodeenv==1.8.0 # via pre-commit -pip-compile-multi==2.6.2 +pip-compile-multi==2.6.3 # via -r requirements/dev.in pip-tools==6.13.0 # via pip-compile-multi -platformdirs==3.5.0 +platformdirs==3.5.1 # via # tox # virtualenv -pre-commit==3.3.1 +pre-commit==3.3.2 # via -r requirements/dev.in pyproject-api==1.5.1 # via tox @@ -50,7 +50,7 @@ pyyaml==6.0 # via pre-commit toposort==1.10 # via pip-compile-multi -tox==4.5.1 +tox==4.5.2 # via -r requirements/dev.in virtualenv==20.23.0 # via diff --git a/requirements/docs.txt b/requirements/docs.txt index c56dde85..bcb3b254 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -9,7 +9,7 @@ alabaster==0.7.13 # via sphinx babel==2.12.1 # via sphinx -certifi==2022.12.7 +certifi==2023.5.7 # via requests charset-normalizer==3.1.0 # via requests @@ -35,7 +35,7 @@ pygments==2.15.1 # via # sphinx # sphinx-tabs -requests==2.29.0 +requests==2.31.0 # via sphinx snowballstemmer==2.2.0 # via sphinx @@ -64,5 +64,5 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -urllib3==1.26.15 +urllib3==2.0.2 # via requests diff --git a/requirements/tests.txt b/requirements/tests.txt index 29044fb5..33e455d1 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -5,7 +5,7 @@ # # pip-compile-multi # -asgiref==3.6.0 +asgiref==3.7.2 # via -r requirements/tests.in iniconfig==2.0.0 # via pytest diff --git a/requirements/typing.txt b/requirements/typing.txt index 82b3e7e7..f246d632 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -7,9 +7,9 @@ # cffi==1.15.1 # via cryptography -cryptography==40.0.2 +cryptography==41.0.0 # via -r requirements/typing.in -mypy==1.2.0 +mypy==1.3.0 # via -r requirements/typing.in mypy-extensions==1.0.0 # via mypy @@ -19,7 +19,7 @@ types-contextvars==2.4.7.2 # via -r requirements/typing.in types-dataclasses==0.6.6 # via -r requirements/typing.in -types-setuptools==67.7.0.1 +types-setuptools==67.8.0.0 # via -r requirements/typing.in -typing-extensions==4.5.0 +typing-extensions==4.6.2 # via mypy diff --git a/src/flask/config.py b/src/flask/config.py index a73dd786..5f921b4d 100644 --- a/src/flask/config.py +++ b/src/flask/config.py @@ -72,7 +72,9 @@ class Config(dict): :param defaults: an optional dictionary of default values """ - def __init__(self, root_path: str, defaults: dict | None = None) -> None: + def __init__( + self, root_path: str | os.PathLike, defaults: dict | None = None + ) -> None: super().__init__(defaults or {}) self.root_path = root_path @@ -164,7 +166,7 @@ class Config(dict): return True - def from_pyfile(self, filename: str, silent: bool = False) -> bool: + def from_pyfile(self, filename: str | os.PathLike, silent: bool = False) -> bool: """Updates the values in the config from a Python file. This function behaves as if the file was imported as module with the :meth:`from_object` function. @@ -233,7 +235,7 @@ class Config(dict): def from_file( self, - filename: str, + filename: str | os.PathLike, load: t.Callable[[t.IO[t.Any]], t.Mapping], silent: bool = False, text: bool = True,