Merge branch '2.3.x'

This commit is contained in:
David Lord 2023-06-27 14:18:56 -07:00
commit 15a0d4afd4
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
14 changed files with 51 additions and 65 deletions

View file

@ -3,7 +3,7 @@ set -e
python3 -m venv .venv python3 -m venv .venv
. .venv/bin/activate . .venv/bin/activate
pip install -U pip setuptools wheel pip install -U pip
pip install -r requirements/dev.txt pip install -r requirements/dev.txt
pip install -e . pip install -e .
pre-commit install --install-hooks pre-commit install --install-hooks

View file

@ -5,6 +5,7 @@ Unreleased
- Python 3.12 compatibility. - Python 3.12 compatibility.
- Require Werkzeug >= 2.3.6. - Require Werkzeug >= 2.3.6.
- Use ``flit_core`` instead of ``setuptools`` as build backend.
- Refactor how an app's root and instance paths are determined. :issue:`5160` - Refactor how an app's root and instance paths are determined. :issue:`5160`
@ -308,7 +309,7 @@ Released 2022-03-28
or ``AppContext.g`` instead. :issue:`3898` or ``AppContext.g`` instead. :issue:`3898`
- ``copy_current_request_context`` can decorate async functions. - ``copy_current_request_context`` can decorate async functions.
:pr:`4303` :pr:`4303`
- The CLI uses ``importlib.metadata`` instead of ``setuptools`` to - The CLI uses ``importlib.metadata`` instead of ``pkg_resources`` to
load command entry points. :issue:`4419` load command entry points. :issue:`4419`
- Overriding ``FlaskClient.open`` will not cause an error on redirect. - Overriding ``FlaskClient.open`` will not cause an error on redirect.
:issue:`3396` :issue:`3396`

View file

@ -127,7 +127,7 @@ First time setup in your local environment
.. code-block:: text .. code-block:: text
$ python -m pip install -U pip setuptools wheel $ python -m pip install -U pip
$ pip install -r requirements/dev.txt && pip install -e . $ pip install -r requirements/dev.txt && pip install -e .
- Install the pre-commit hooks. - Install the pre-commit hooks.

View file

@ -1,11 +0,0 @@
include CHANGES.rst
include CONTRIBUTING.rst
include tox.ini
include requirements/*.txt
graft artwork
graft docs
prune docs/_build
graft examples
graft tests
include src/flask/py.typed
global-exclude *.pyc

View file

@ -54,8 +54,8 @@ a big problem, just add a new file called :file:`pyproject.toml` next to the inn
] ]
[build-system] [build-system]
requires = ["setuptools"] requires = ["flit_core<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
Install your application so it is importable: Install your application so it is importable:

View file

@ -40,30 +40,13 @@ The ``pyproject.toml`` file describes your project and how to build it.
] ]
[build-system] [build-system]
requires = ["setuptools"] requires = ["flit_core<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
See the official `Packaging tutorial <packaging tutorial_>`_ for more
The setuptools build backend needs another file named ``MANIFEST.in`` to tell it about explanation of the files and options used.
non-Python files to include.
.. code-block:: none
:caption: ``MANIFEST.in``
include flaskr/schema.sql
graft flaskr/static
graft flaskr/templates
global-exclude *.pyc
This tells the build to copy everything in the ``static`` and ``templates`` directories,
and the ``schema.sql`` file, but to exclude all bytecode files.
See the official `Packaging tutorial <packaging tutorial_>`_ and
`detailed guide <packaging guide_>`_ for more explanation of the files
and options used.
.. _packaging tutorial: https://packaging.python.org/tutorials/packaging-projects/ .. _packaging tutorial: https://packaging.python.org/tutorials/packaging-projects/
.. _packaging guide: https://packaging.python.org/guides/distributing-packages-using-setuptools/
Install the Project Install the Project
@ -95,9 +78,7 @@ You can observe that the project is now installed with ``pip list``.
Jinja2 2.10 Jinja2 2.10
MarkupSafe 1.0 MarkupSafe 1.0
pip 9.0.3 pip 9.0.3
setuptools 39.0.1
Werkzeug 0.14.1 Werkzeug 0.14.1
wheel 0.30.0
Nothing changes from how you've been running your project so far. Nothing changes from how you've been running your project so far.
``--app`` is still set to ``flaskr`` and ``flask run`` still runs ``--app`` is still set to ``flaskr`` and ``flask run`` still runs

View file

@ -7,5 +7,8 @@ requires-python = ">=3.8"
dependencies = ["flask>=2.2.2", "celery[redis]>=5.2.7"] dependencies = ["flask>=2.2.2", "celery[redis]>=5.2.7"]
[build-system] [build-system]
requires = ["setuptools"] requires = ["flit_core<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
[tool.flit.module]
name = "task_app"

View file

@ -1,4 +0,0 @@
include LICENSE.rst
graft js_example/templates
graft tests
global-exclude *.pyc

View file

@ -3,7 +3,7 @@ name = "js_example"
version = "1.1.0" version = "1.1.0"
description = "Demonstrates making AJAX requests to Flask." description = "Demonstrates making AJAX requests to Flask."
readme = "README.rst" readme = "README.rst"
license = {text = "BSD-3-Clause"} license = {file = "LICENSE.rst"}
maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}] maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]
dependencies = ["flask"] dependencies = ["flask"]
@ -14,8 +14,11 @@ Documentation = "https://flask.palletsprojects.com/patterns/jquery/"
test = ["pytest"] test = ["pytest"]
[build-system] [build-system]
requires = ["setuptools"] requires = ["flit_core<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
[tool.flit.module]
name = "js_example"
[tool.pytest.ini_options] [tool.pytest.ini_options]
testpaths = ["tests"] testpaths = ["tests"]

View file

@ -1,6 +0,0 @@
include LICENSE.rst
include flaskr/schema.sql
graft flaskr/static
graft flaskr/templates
graft tests
global-exclude *.pyc

View file

@ -16,8 +16,16 @@ Documentation = "https://flask.palletsprojects.com/tutorial/"
test = ["pytest"] test = ["pytest"]
[build-system] [build-system]
requires = ["setuptools"] requires = ["flit_core<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
[tool.flit.module]
name = "flaskr"
[tool.flit.sdist]
include = [
"tests/",
]
[tool.pytest.ini_options] [tool.pytest.ini_options]
testpaths = ["tests"] testpaths = ["tests"]

View file

@ -2,7 +2,7 @@
name = "Flask" name = "Flask"
description = "A simple framework for building complex web applications." description = "A simple framework for building complex web applications."
readme = "README.rst" readme = "README.rst"
license = {text = "BSD-3-Clause"} license = {file = "LICENSE.rst"}
maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}] maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]
classifiers = [ classifiers = [
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
@ -44,11 +44,25 @@ dotenv = ["python-dotenv"]
flask = "flask.cli:main" flask = "flask.cli:main"
[build-system] [build-system]
requires = ["setuptools"] requires = ["flit_core<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
[tool.setuptools.dynamic] [tool.flit.module]
version = {attr = "flask.__version__"} name = "flask"
[tool.flit.sdist]
include = [
"docs/",
"examples/",
"requirements/",
"tests/",
"CHANGES.rst",
"CONTRIBUTING.rst",
"tox.ini",
]
exclude = [
"docs/_build/",
]
[tool.pytest.ini_options] [tool.pytest.ini_options]
testpaths = ["tests"] testpaths = ["tests"]

View file

@ -1,5 +1,4 @@
mypy mypy
types-contextvars types-contextvars
types-dataclasses types-dataclasses
types-setuptools
cryptography cryptography

View file

@ -1,4 +1,4 @@
# SHA1:7cc3f64d4e78db89d81680ac81503d5ac35d31a9 # SHA1:6a354b832686fd3ec017455769a0270953a1e225
# #
# This file is autogenerated by pip-compile-multi # This file is autogenerated by pip-compile-multi
# To update, run: # To update, run:
@ -19,7 +19,5 @@ types-contextvars==2.4.7.2
# via -r requirements/typing.in # via -r requirements/typing.in
types-dataclasses==0.6.6 types-dataclasses==0.6.6
# via -r requirements/typing.in # via -r requirements/typing.in
types-setuptools==68.0.0.0
# via -r requirements/typing.in
typing-extensions==4.6.3 typing-extensions==4.6.3
# via mypy # via mypy