Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pallets/flask
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.0.0
Choose a base ref
...
head repository: pallets/flask
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.0.1
Choose a head ref

Commits on Sep 30, 2023

  1. Bump Werkzeug 3.0.0

    pgjones committed Sep 30, 2023
    Copy the full SHA
    3252f2b View commit details
  2. Release version 3.0.0

    pgjones committed Sep 30, 2023
    Copy the full SHA
    1423251 View commit details

Commits on Nov 15, 2023

  1. Copy the full SHA
    54e05a2 View commit details
  2. update read the docs env

    (cherry picked from commit 29f1bd2)
    davidism committed Nov 15, 2023
    Copy the full SHA
    6277036 View commit details
  3. update python version matrix

    (cherry picked from commit 6ee5dcc)
    davidism committed Nov 15, 2023
    Copy the full SHA
    560383f View commit details
  4. Copy the full SHA
    59fd6aa View commit details
  5. update pre-commit hooks

    davidism committed Nov 15, 2023
    Copy the full SHA
    5308db0 View commit details
  6. start version 3.0.1

    davidism committed Nov 15, 2023
    Copy the full SHA
    66743d4 View commit details
  7. type hint fix for flask.send_file

    dannyi96 authored and davidism committed Nov 15, 2023
    Copy the full SHA
    4104f29 View commit details
  8. Copy the full SHA
    b97165d View commit details

Commits on Dec 13, 2023

  1. Fixing issue 5342: 'The double quote is missing in the string'

    lizardwine authored and davidism committed Dec 13, 2023
    Copy the full SHA
    1d5abfa View commit details
  2. Copy the full SHA
    05eebe3 View commit details
  3. Update docs to address redesigned macOS settings app

    huebs authored and davidism committed Dec 13, 2023
    Copy the full SHA
    8a66990 View commit details
  4. Copy the full SHA
    77f6c72 View commit details

Commits on Dec 14, 2023

  1. run typing tests

    davidism committed Dec 14, 2023
    Copy the full SHA
    c275573 View commit details

Commits on Jan 15, 2024

  1. untag without object_hook

    davidism committed Jan 15, 2024
    Copy the full SHA
    700fc7d View commit details
  2. untag without object_hook (#5382)

    davidism authored Jan 15, 2024
    Copy the full SHA
    5a48a0f View commit details

Commits on Jan 16, 2024

  1. address mypy strict findings

    davidism committed Jan 16, 2024
    Copy the full SHA
    6000e80 View commit details
  2. update pre-commit hooks

    davidism committed Jan 16, 2024
    Copy the full SHA
    08d3185 View commit details

Commits on Jan 18, 2024

  1. update requirements

    davidism committed Jan 18, 2024
    Copy the full SHA
    81b3c85 View commit details
  2. address mypy strict findings (#5383)

    davidism authored Jan 18, 2024
    Copy the full SHA
    bae6ee8 View commit details
  3. update actions versions

    davidism committed Jan 18, 2024
    Copy the full SHA
    5e059be View commit details
  4. fix slsa generator version

    davidism committed Jan 18, 2024
    Copy the full SHA
    da3a0dd View commit details
  5. fix create release action

    davidism committed Jan 18, 2024
    Copy the full SHA
    5fcc999 View commit details
  6. release version 3.0.1

    davidism committed Jan 18, 2024
    Copy the full SHA
    f622b1c View commit details
Showing with 706 additions and 532 deletions.
  1. +0 −25 .flake8
  2. +1 −5 .github/workflows/lock.yaml
  3. +13 −16 .github/workflows/publish.yaml
  4. +10 −13 .github/workflows/tests.yaml
  5. +7 −22 .gitignore
  6. +7 −28 .pre-commit-config.yaml
  7. +2 −2 .readthedocs.yaml
  8. +15 −1 CHANGES.rst
  9. +2 −2 docs/server.rst
  10. +3 −0 examples/celery/pyproject.toml
  11. +1 −1 examples/javascript/js_example/views.py
  12. +3 −0 examples/javascript/pyproject.toml
  13. +3 −2 examples/tutorial/flaskr/__init__.py
  14. +1 −1 examples/tutorial/flaskr/auth.py
  15. +2 −2 examples/tutorial/flaskr/blog.py
  16. +3 −0 examples/tutorial/pyproject.toml
  17. +25 −18 pyproject.toml
  18. +2 −0 requirements-skip/README.md
  19. +6 −0 requirements-skip/tests-dev.txt
  20. +3 −3 requirements/tests-pallets-min.in → requirements-skip/tests-min.in
  21. +21 −0 requirements-skip/tests-min.txt
  22. +6 −7 requirements/build.txt
  23. +1 −1 requirements/dev.in
  24. +116 −29 requirements/dev.txt
  25. +2 −2 requirements/docs.in
  26. +24 −30 requirements/docs.txt
  27. +0 −22 requirements/tests-pallets-min.txt
  28. +9 −10 requirements/tests.txt
  29. +2 −0 requirements/typing.in
  30. +15 −12 requirements/typing.txt
  31. +32 −22 src/flask/app.py
  32. +1 −1 src/flask/blueprints.py
  33. +91 −50 src/flask/cli.py
  34. +35 −10 src/flask/config.py
  35. +19 −10 src/flask/ctx.py
  36. +26 −8 src/flask/debughelpers.py
  37. +12 −14 src/flask/helpers.py
  38. +1 −1 src/flask/json/__init__.py
  39. +4 −5 src/flask/json/provider.py
  40. +18 −6 src/flask/json/tag.py
  41. +4 −1 src/flask/logging.py
  42. +21 −17 src/flask/sansio/app.py
  43. +20 −14 src/flask/sansio/blueprints.py
  44. +36 −34 src/flask/sansio/scaffold.py
  45. +16 −12 src/flask/sessions.py
  46. +8 −10 src/flask/templating.py
  47. +8 −5 src/flask/testing.py
  48. +4 −2 src/flask/typing.py
  49. +5 −4 src/flask/views.py
  50. +5 −4 src/flask/wrappers.py
  51. +3 −6 tests/test_appctx.py
  52. +0 −1 tests/test_apps/subdomaintestmodule/__init__.py
  53. +13 −11 tests/test_basic.py
  54. +5 −4 tests/test_blueprints.py
  55. +2 −2 tests/test_signals.py
  56. +4 −7 tests/test_testing.py
  57. +2 −2 tests/test_views.py
  58. +2 −4 tests/typing/typing_app_decorators.py
  59. +2 −2 tests/typing/typing_route.py
  60. +2 −9 tox.ini
25 changes: 0 additions & 25 deletions .flake8

This file was deleted.

6 changes: 1 addition & 5 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -3,23 +3,19 @@ name: 'Lock threads'
# two weeks. This does not close open issues, only humans may do that.
# We find that it is easier to respond to new issues with fresh examples
# rather than continuing discussions on old issues.

on:
schedule:
- cron: '0 0 * * *'

permissions:
issues: write
pull-requests: write

concurrency:
group: lock

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21
- uses: dessant/lock-threads@7de207be1d3ce97a9abe6ff1306222982d1ca9f9
with:
issue-inactive-days: 14
pr-inactive-days: 14
29 changes: 13 additions & 16 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -9,12 +9,12 @@ jobs:
outputs:
hash: ${{ steps.hash.outputs.hash }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
cache: pip
cache-dependency-path: requirements*/*.txt
- run: pip install -r requirements/build.txt
# Use the commit date instead of the current date during the build.
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
@@ -23,11 +23,12 @@ jobs:
- name: generate hash
id: hash
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: dist
path: ./dist
provenance:
needs: ['build']
needs: [build]
permissions:
actions: read
id-token: write
@@ -39,7 +40,7 @@ jobs:
create-release:
# Upload the sdist, wheels, and provenance to a GitHub release. They remain
# available as build artifacts for a while as well.
needs: ['provenance']
needs: [provenance]
runs-on: ubuntu-latest
permissions:
contents: write
@@ -49,24 +50,20 @@ jobs:
run: >
gh release create --draft --repo ${{ github.repository }}
${{ github.ref_name }}
*.intoto.jsonl/* artifact/*
*.intoto.jsonl/* dist/*
env:
GH_TOKEN: ${{ github.token }}
publish-pypi:
needs: ['provenance']
needs: [provenance]
# Wait for approval before attempting to upload to PyPI. This allows reviewing the
# files in the draft release.
environment: 'publish'
environment: publish
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
# Try uploading to Test PyPI first, in case something fails.
- uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
- uses: pypa/gh-action-pypi-publish@f946db0f765b9ae754e44bfd5ae5b8b91cfb37ef
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: artifact/
- uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
with:
packages-dir: artifact/
- uses: pypa/gh-action-pypi-publish@f946db0f765b9ae754e44bfd5ae5b8b91cfb37ef
23 changes: 10 additions & 13 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -9,9 +9,6 @@ on:
- '*.md'
- '*.rst'
pull_request:
branches:
- main
- '*.x'
paths-ignore:
- 'docs/**'
- '*.md'
@@ -24,26 +21,26 @@ jobs:
fail-fast: false
matrix:
include:
- {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}
- {name: Windows, python: '3.11', os: windows-latest, tox: py311}
- {name: Mac, python: '3.11', os: macos-latest, tox: py311}
- {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312}
- {name: Linux, python: '3.12', os: ubuntu-latest, tox: py312}
- {name: Windows, python: '3.12', os: windows-latest, tox: py312}
- {name: Mac, python: '3.12', os: macos-latest, tox: py312}
- {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310}
- {name: 'Minimum Versions', python: '3.11', os: ubuntu-latest, tox: py311-min}
- {name: 'Minimum Versions', python: '3.12', os: ubuntu-latest, tox: py312-min}
- {name: 'Development Versions', python: '3.8', os: ubuntu-latest, tox: py38-dev}
- {name: Typing, python: '3.11', os: ubuntu-latest, tox: typing}
- {name: Typing, python: '3.12', os: ubuntu-latest, tox: typing}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
cache-dependency-path: requirements*/*.txt
- name: cache mypy
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
with:
path: ./.mypy_cache
key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}
29 changes: 7 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
.DS_Store
.env
.flaskenv
*.pyc
*.pyo
env/
venv/
.venv/
env*
dist/
build/
*.egg
*.egg-info/
.tox/
.cache/
.pytest_cache/
.idea/
docs/_build/
.vscode

# Coverage reports
htmlcov/
.vscode/
__pycache__/
.tox/
.coverage
.coverage.*
*,cover
htmlcov/
docs/_build/
dist/
venv/
35 changes: 7 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
ci:
autoupdate_branch: "2.3.x"
autoupdate_schedule: monthly
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
hooks:
- id: pyupgrade
args: ["--py38-plus"]
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.10.0
hooks:
- id: reorder-python-imports
name: Reorder Python imports (src, tests)
files: "^(?!examples/)"
args: ["--application-directories", "src"]
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/peterdemin/pip-compile-multi
rev: v2.6.3
hooks:
- id: pip-compile-multi-verify
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: fix-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"
python:
install:
- requirements: requirements/docs.txt
16 changes: 15 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
Version 3.0.1
-------------

Released 2024-01-18

- Correct type for ``path`` argument to ``send_file``. :issue:`5230`
- Fix a typo in an error message for the ``flask run --key`` option. :pr:`5344`
- Session data is untagged without relying on the built-in ``json.loads``
``object_hook``. This allows other JSON providers that don't implement that.
:issue:`5381`
- Address more type findings when using mypy strict mode. :pr:`5383`


Version 3.0.0
-------------

Unreleased
Released 2023-09-30

- Remove previously deprecated code. :pr:`5223`
- Deprecate the ``__version__`` attribute. Use feature detection, or
``importlib.metadata.version("flask")``, instead. :issue:`5230`
- Restructure the code such that the Flask (app) and Blueprint
classes have Sans-IO bases. :pr:`5127`
- Allow self as an argument to url_for. :pr:`5264`
- Require Werkzeug >= 3.0.0.


Version 2.3.3
4 changes: 2 additions & 2 deletions docs/server.rst
Original file line number Diff line number Diff line change
@@ -76,8 +76,8 @@ following example shows that process id 6847 is using port 5000.
TCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 6847
macOS Monterey and later automatically starts a service that uses port
5000. To disable the service, go to System Preferences, Sharing, and
disable "AirPlay Receiver".
5000. You can choose to disable this service instead of using a different port by
searching for "AirPlay Receiver" in System Preferences and toggling it off.


Deferred Errors on Reload
3 changes: 3 additions & 0 deletions examples/celery/pyproject.toml
Original file line number Diff line number Diff line change
@@ -12,3 +12,6 @@ build-backend = "flit_core.buildapi"

[tool.flit.module]
name = "task_app"

[tool.ruff]
src = ["src"]
2 changes: 1 addition & 1 deletion examples/javascript/js_example/views.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
from flask import render_template
from flask import request

from js_example import app
from . import app


@app.route("/", defaults={"js": "fetch"})
3 changes: 3 additions & 0 deletions examples/javascript/pyproject.toml
Original file line number Diff line number Diff line change
@@ -27,3 +27,6 @@ filterwarnings = ["error"]
[tool.coverage.run]
branch = true
source = ["js_example", "tests"]

[tool.ruff]
src = ["src"]
5 changes: 3 additions & 2 deletions examples/tutorial/flaskr/__init__.py
Original file line number Diff line number Diff line change
@@ -31,12 +31,13 @@ def hello():
return "Hello, World!"

# register the database commands
from flaskr import db
from . import db

db.init_app(app)

# apply the blueprints to the app
from flaskr import auth, blog
from . import auth
from . import blog

app.register_blueprint(auth.bp)
app.register_blueprint(blog.bp)
2 changes: 1 addition & 1 deletion examples/tutorial/flaskr/auth.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
from werkzeug.security import check_password_hash
from werkzeug.security import generate_password_hash

from flaskr.db import get_db
from .db import get_db

bp = Blueprint("auth", __name__, url_prefix="/auth")

4 changes: 2 additions & 2 deletions examples/tutorial/flaskr/blog.py
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@
from flask import url_for
from werkzeug.exceptions import abort

from flaskr.auth import login_required
from flaskr.db import get_db
from .auth import login_required
from .db import get_db

bp = Blueprint("blog", __name__)

3 changes: 3 additions & 0 deletions examples/tutorial/pyproject.toml
Original file line number Diff line number Diff line change
@@ -34,3 +34,6 @@ filterwarnings = ["error"]
[tool.coverage.run]
branch = true
source = ["flaskr", "tests"]

[tool.ruff]
src = ["src"]
Loading