Merge branch '2.3.x'

This commit is contained in:
David Lord 2023-05-31 09:19:14 -07:00
commit 31fd9c8791
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
9 changed files with 26 additions and 25 deletions

View file

@ -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

View file

@ -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:

View file

@ -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,

View file

@ -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",

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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,