Skip to content
Myr

update project files (#5457)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* update pre-commit hook * upgrade pip with venv * update description and version * show url in publish environment * update versions * update versions, separate typing job * use dependabot grouped updates ignore upload/download-artifact until slsa updates * use sphinx.ext.extlinks instead of sphinx-issues * update dev dependencies * update editorconfig * update gitignore * update .readthedocs.yaml * license is txt, readme is md * update pyproject.toml add typed classifier add pyright config simplify urls * tox builds docs in place * update min test py version * add tox env to update all dev dependencies * update issue and pr templates * rename security docs page to not conflict with org policy file * simplify matrix

authored by David Lord · committed by GitHub · parent d5e321b · Browse files · 37 files+678 added−618 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

37 files+678 added−618 removed

  • tests:+5 added−9 removed
  • other:+673 added−609 removed

37 files+678 added−618 removed

modified:.devcontainer/on-create-command.sh+1 added-3 removed
modified:.github/ISSUE_TEMPLATE/bug-report.md+1 added-1 removed
modified:.github/ISSUE_TEMPLATE/config.yml+6 added-6 removed
modified:.github/workflows/lock.yaml+8 added-6 removed
modified:.github/workflows/publish.yaml+15 added-11 removed
modified:.github/workflows/tests.yaml+30 added-20 removed
modified:.github/dependabot.yml+22 added-7 removed
1version: 22updates:3- package-ecosystem: "github-actions"4 directory: "/"5 schedule:6 interval: "monthly"7 day: "monday"8 time: "16:00"9 timezone: "UTC"3 - package-ecosystem: github-actions4 directory: /5 schedule:6 interval: monthly7 ignore:8 # slsa depends on upload/download v39 - dependency-name: actions/upload-artifact10 versions: '>= 4'11 - dependency-name: actions/download-artifact12 versions: '>= 4'13 groups:14 github-actions:15 patterns:16 - '*'17 - package-ecosystem: pip18 directory: /requirements/19 schedule:20 interval: monthly21 groups:22 python-requirements:23 patterns:24 - '*'
modified:.github/pull_request_template.md+10 added-15 removed
1<!--2Before opening a PR, open a ticket describing the issue or feature the3PR will address. Follow the steps in CONTRIBUTING.rst.3PR will address. An issue is not required for fixing typos in4documentation, or other simple non-code changes.56Replace this comment with a description of the change. Describe how it7addresses the linked ticket.8-->910<!--11Link to relevant issues or previous PRs, one per line. Use "fixes" to12automatically close an issue.1314fixes #<issue number>15-->1614- fixes #<issue number>1517<!--17Ensure each step in CONTRIBUTING.rst is complete by adding an "x" to18each box below.18Ensure each step in CONTRIBUTING.rst is complete, especially the following:1920If only docs were changed, these aren't relevant and can be removed.20- Add tests that demonstrate the correct behavior of the change. Tests21 should fail without the change.22- Add or update relevant docs, in the docs folder and in code.23- Add an entry in CHANGES.rst summarizing the change and linking to the issue.24- Add `.. versionchanged::` entries in any relevant code docs.25-->2223Checklist:2425- [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.26- [ ] Add or update relevant docs, in the docs folder and in code.27- [ ] Add an entry in `CHANGES.rst` summarizing the change and linking to the issue.28- [ ] Add `.. versionchanged::` entries in any relevant code docs.29- [ ] Run `pre-commit` hooks and fix any issues.30- [ ] Run `pytest` and `tox`, no tests failed.
deleted:.github/SECURITY.md-19 removed
1# Security Policy23If you believe you have identified a security issue with a Pallets4project, **do not open a public issue**. To responsibly report a5security issue, please email security@palletsprojects.com. A security6team member will contact you acknowledging the report and how to7continue.89Be sure to include as much detail as necessary in your report. As with10reporting normal issues, a minimal reproducible example will help the11maintainers address the issue faster. If you are able, you may also12include a fix for the issue generated with `git format-patch`.1314The current and previous release will receive security patches, with15older versions evaluated based on usage information and severity.1617After fixing an issue, we will make a security release along with an18announcement on our blog. We may obtain a CVE id as well. You may19include a name and link if you would like to be credited for the report.
modified:docs/conf.py+9 added-8 removed
9 unmodified lines
10release, version = get_version("Flask")1112# General --------------------------------------------------------------1314master_doc = "index"14default_role = "code"15extensions = [16 "sphinx.ext.autodoc",17 "sphinx.ext.extlinks",18 "sphinx.ext.intersphinx",19 "sphinxcontrib.log_cabinet",19 "pallets_sphinx_themes",20 "sphinx_issues",20 "sphinx_tabs.tabs",21 "pallets_sphinx_themes",22]23autodoc_member_order = "bysource"24autodoc_typehints = "description"25autodoc_preserve_defaults = True26extlinks = {27 "issue": ("https://github.com/pallets/flask/issues/%s", "#%s"),28 "pr": ("https://github.com/pallets/flask/pull/%s", "#%s"),29}30intersphinx_mapping = {31 "python": ("https://docs.python.org/3/", None),32 "werkzeug": ("https://werkzeug.palletsprojects.com/", None),33 "click": ("https://click.palletsprojects.com/", None),
2 unmodified lines
36 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),37 "wtforms": ("https://wtforms.readthedocs.io/", None),38 "blinker": ("https://blinker.readthedocs.io/", None),39}34issues_github_path = "pallets/flask"4041# HTML -----------------------------------------------------------------4243html_theme = "flask"
17 unmodified lines
61html_logo = "_static/flask-vertical.png"62html_title = f"Flask Documentation ({version})"63html_show_sourcelink = False6460# LaTeX ----------------------------------------------------------------6162latex_documents = [(master_doc, f"Flask-{version}.tex", html_title, author, "manual")]6365# Local Extensions -----------------------------------------------------666768def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):
29 unmodified lines
modified:docs/index.rst+1 added-1 removed
52 unmodified lines
53 cli54 server55 shell56 patterns/index57 security57 web-security58 deploying/index59 async-await6061
23 unmodified lines
modified:docs/license.rst+2 added-1 removed
1BSD-3-Clause License2====================34.. include:: ../LICENSE.rst4.. literalinclude:: ../LICENSE.txt5 :language: text
deleted:docs/security.rst-274 removed
1Security Considerations2=======================34Web applications usually face all kinds of security problems and it's very5hard to get everything right. Flask tries to solve a few of these things6for you, but there are a couple more you have to take care of yourself.78.. _security-xss:910Cross-Site Scripting (XSS)11--------------------------1213Cross site scripting is the concept of injecting arbitrary HTML (and with14it JavaScript) into the context of a website. To remedy this, developers15have to properly escape text so that it cannot include arbitrary HTML16tags. For more information on that have a look at the Wikipedia article17on `Cross-Site Scripting18<https://en.wikipedia.org/wiki/Cross-site_scripting>`_.1920Flask configures Jinja2 to automatically escape all values unless21explicitly told otherwise. This should rule out all XSS problems caused22in templates, but there are still other places where you have to be23careful:2425- generating HTML without the help of Jinja226- calling :class:`~markupsafe.Markup` on data submitted by users27- sending out HTML from uploaded files, never do that, use the28 ``Content-Disposition: attachment`` header to prevent that problem.29- sending out textfiles from uploaded files. Some browsers are using30 content-type guessing based on the first few bytes so users could31 trick a browser to execute HTML.3233Another thing that is very important are unquoted attributes. While34Jinja2 can protect you from XSS issues by escaping HTML, there is one35thing it cannot protect you from: XSS by attribute injection. To counter36this possible attack vector, be sure to always quote your attributes with37either double or single quotes when using Jinja expressions in them:3839.. sourcecode:: html+jinja4041 <input value="{{ value }}">4243Why is this necessary? Because if you would not be doing that, an44attacker could easily inject custom JavaScript handlers. For example an45attacker could inject this piece of HTML+JavaScript:4647.. sourcecode:: html4849 onmouseover=alert(document.cookie)5051When the user would then move with the mouse over the input, the cookie52would be presented to the user in an alert window. But instead of showing53the cookie to the user, a good attacker might also execute any other54JavaScript code. In combination with CSS injections the attacker might55even make the element fill out the entire page so that the user would56just have to have the mouse anywhere on the page to trigger the attack.5758There is one class of XSS issues that Jinja's escaping does not protect59against. The ``a`` tag's ``href`` attribute can contain a `javascript:` URI,60which the browser will execute when clicked if not secured properly.6162.. sourcecode:: html6364 <a href="{{ value }}">click here</a>65 <a href="javascript:alert('unsafe');">click here</a>6667To prevent this, you'll need to set the :ref:`security-csp` response header.6869Cross-Site Request Forgery (CSRF)70---------------------------------7172Another big problem is CSRF. This is a very complex topic and I won't73outline it here in detail just mention what it is and how to theoretically74prevent it.7576If your authentication information is stored in cookies, you have implicit77state management. The state of "being logged in" is controlled by a78cookie, and that cookie is sent with each request to a page.79Unfortunately that includes requests triggered by 3rd party sites. If you80don't keep that in mind, some people might be able to trick your81application's users with social engineering to do stupid things without82them knowing.8384Say you have a specific URL that, when you sent ``POST`` requests to will85delete a user's profile (say ``http://example.com/user/delete``). If an86attacker now creates a page that sends a post request to that page with87some JavaScript they just have to trick some users to load that page and88their profiles will end up being deleted.8990Imagine you were to run Facebook with millions of concurrent users and91someone would send out links to images of little kittens. When users92would go to that page, their profiles would get deleted while they are93looking at images of fluffy cats.9495How can you prevent that? Basically for each request that modifies96content on the server you would have to either use a one-time token and97store that in the cookie **and** also transmit it with the form data.98After receiving the data on the server again, you would then have to99compare the two tokens and ensure they are equal.100101Why does Flask not do that for you? The ideal place for this to happen is102the form validation framework, which does not exist in Flask.103104.. _security-json:105106JSON Security107-------------108109In Flask 0.10 and lower, :func:`~flask.jsonify` did not serialize top-level110arrays to JSON. This was because of a security vulnerability in ECMAScript 4.111112ECMAScript 5 closed this vulnerability, so only extremely old browsers are113still vulnerable. All of these browsers have `other more serious114vulnerabilities115<https://github.com/pallets/flask/issues/248#issuecomment-59934857>`_, so116this behavior was changed and :func:`~flask.jsonify` now supports serializing117arrays.118119Security Headers120----------------121122Browsers recognize various response headers in order to control security. We123recommend reviewing each of the headers below for use in your application.124The `Flask-Talisman`_ extension can be used to manage HTTPS and the security125headers for you.126127.. _Flask-Talisman: https://github.com/GoogleCloudPlatform/flask-talisman128129HTTP Strict Transport Security (HSTS)130~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~131132Tells the browser to convert all HTTP requests to HTTPS, preventing133man-in-the-middle (MITM) attacks. ::134135 response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'136137- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security138139.. _security-csp:140141Content Security Policy (CSP)142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~143144Tell the browser where it can load various types of resource from. This header145should be used whenever possible, but requires some work to define the correct146policy for your site. A very strict policy would be::147148 response.headers['Content-Security-Policy'] = "default-src 'self'"149150- https://csp.withgoogle.com/docs/index.html151- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy152153X-Content-Type-Options154~~~~~~~~~~~~~~~~~~~~~~155156Forces the browser to honor the response content type instead of trying to157detect it, which can be abused to generate a cross-site scripting (XSS)158attack. ::159160 response.headers['X-Content-Type-Options'] = 'nosniff'161162- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options163164X-Frame-Options165~~~~~~~~~~~~~~~166167Prevents external sites from embedding your site in an ``iframe``. This168prevents a class of attacks where clicks in the outer frame can be translated169invisibly to clicks on your page's elements. This is also known as170"clickjacking". ::171172 response.headers['X-Frame-Options'] = 'SAMEORIGIN'173174- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options175176.. _security-cookie:177178Set-Cookie options179~~~~~~~~~~~~~~~~~~180181These options can be added to a ``Set-Cookie`` header to improve their182security. Flask has configuration options to set these on the session cookie.183They can be set on other cookies too.184185- ``Secure`` limits cookies to HTTPS traffic only.186- ``HttpOnly`` protects the contents of cookies from being read with187 JavaScript.188- ``SameSite`` restricts how cookies are sent with requests from189 external sites. Can be set to ``'Lax'`` (recommended) or ``'Strict'``.190 ``Lax`` prevents sending cookies with CSRF-prone requests from191 external sites, such as submitting a form. ``Strict`` prevents sending192 cookies with all external requests, including following regular links.193194::195196 app.config.update(197 SESSION_COOKIE_SECURE=True,198 SESSION_COOKIE_HTTPONLY=True,199 SESSION_COOKIE_SAMESITE='Lax',200 )201202 response.set_cookie('username', 'flask', secure=True, httponly=True, samesite='Lax')203204Specifying ``Expires`` or ``Max-Age`` options, will remove the cookie after205the given time, or the current time plus the age, respectively. If neither206option is set, the cookie will be removed when the browser is closed. ::207208 # cookie expires after 10 minutes209 response.set_cookie('snakes', '3', max_age=600)210211For the session cookie, if :attr:`session.permanent <flask.session.permanent>`212is set, then :data:`PERMANENT_SESSION_LIFETIME` is used to set the expiration.213Flask's default cookie implementation validates that the cryptographic214signature is not older than this value. Lowering this value may help mitigate215replay attacks, where intercepted cookies can be sent at a later time. ::216217 app.config.update(218 PERMANENT_SESSION_LIFETIME=600219 )220221 @app.route('/login', methods=['POST'])222 def login():223 ...224 session.clear()225 session['user_id'] = user.id226 session.permanent = True227 ...228229Use :class:`itsdangerous.TimedSerializer` to sign and validate other cookie230values (or any values that need secure signatures).231232- https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies233- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie234235.. _samesite_support: https://caniuse.com/#feat=same-site-cookie-attribute236237238HTTP Public Key Pinning (HPKP)239~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~240241This tells the browser to authenticate with the server using only the specific242certificate key to prevent MITM attacks.243244.. warning::245 Be careful when enabling this, as it is very difficult to undo if you set up246 or upgrade your key incorrectly.247248- https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning249250251Copy/Paste to Terminal252----------------------253254Hidden characters such as the backspace character (``\b``, ``^H``) can255cause text to render differently in HTML than how it is interpreted if256`pasted into a terminal <https://security.stackexchange.com/q/39118>`__.257258For example, ``import y\bose\bm\bi\bt\be\b`` renders as259``import yosemite`` in HTML, but the backspaces are applied when pasted260into a terminal, and it becomes ``import os``.261262If you expect users to copy and paste untrusted code from your site,263such as from comments posted by users on a technical blog, consider264applying extra filtering, such as replacing all ``\b`` characters.265266.. code-block:: python267268 body = body.replace("\b", "")269270Most modern terminals will warn about and remove hidden characters when271pasting, so this isn't strictly necessary. It's also possible to craft272dangerous commands in other ways that aren't possible to filter.273Depending on your site's use case, it may be good to show a warning274about copying code in general.
added:docs/web-security.rst+274 added
1Security Considerations2=======================34Web applications usually face all kinds of security problems and it's very5hard to get everything right. Flask tries to solve a few of these things6for you, but there are a couple more you have to take care of yourself.78.. _security-xss:910Cross-Site Scripting (XSS)11--------------------------1213Cross site scripting is the concept of injecting arbitrary HTML (and with14it JavaScript) into the context of a website. To remedy this, developers15have to properly escape text so that it cannot include arbitrary HTML16tags. For more information on that have a look at the Wikipedia article17on `Cross-Site Scripting18<https://en.wikipedia.org/wiki/Cross-site_scripting>`_.1920Flask configures Jinja2 to automatically escape all values unless21explicitly told otherwise. This should rule out all XSS problems caused22in templates, but there are still other places where you have to be23careful:2425- generating HTML without the help of Jinja226- calling :class:`~markupsafe.Markup` on data submitted by users27- sending out HTML from uploaded files, never do that, use the28 ``Content-Disposition: attachment`` header to prevent that problem.29- sending out textfiles from uploaded files. Some browsers are using30 content-type guessing based on the first few bytes so users could31 trick a browser to execute HTML.3233Another thing that is very important are unquoted attributes. While34Jinja2 can protect you from XSS issues by escaping HTML, there is one35thing it cannot protect you from: XSS by attribute injection. To counter36this possible attack vector, be sure to always quote your attributes with37either double or single quotes when using Jinja expressions in them:3839.. sourcecode:: html+jinja4041 <input value="{{ value }}">4243Why is this necessary? Because if you would not be doing that, an44attacker could easily inject custom JavaScript handlers. For example an45attacker could inject this piece of HTML+JavaScript:4647.. sourcecode:: html4849 onmouseover=alert(document.cookie)5051When the user would then move with the mouse over the input, the cookie52would be presented to the user in an alert window. But instead of showing53the cookie to the user, a good attacker might also execute any other54JavaScript code. In combination with CSS injections the attacker might55even make the element fill out the entire page so that the user would56just have to have the mouse anywhere on the page to trigger the attack.5758There is one class of XSS issues that Jinja's escaping does not protect59against. The ``a`` tag's ``href`` attribute can contain a `javascript:` URI,60which the browser will execute when clicked if not secured properly.6162.. sourcecode:: html6364 <a href="{{ value }}">click here</a>65 <a href="javascript:alert('unsafe');">click here</a>6667To prevent this, you'll need to set the :ref:`security-csp` response header.6869Cross-Site Request Forgery (CSRF)70---------------------------------7172Another big problem is CSRF. This is a very complex topic and I won't73outline it here in detail just mention what it is and how to theoretically74prevent it.7576If your authentication information is stored in cookies, you have implicit77state management. The state of "being logged in" is controlled by a78cookie, and that cookie is sent with each request to a page.79Unfortunately that includes requests triggered by 3rd party sites. If you80don't keep that in mind, some people might be able to trick your81application's users with social engineering to do stupid things without82them knowing.8384Say you have a specific URL that, when you sent ``POST`` requests to will85delete a user's profile (say ``http://example.com/user/delete``). If an86attacker now creates a page that sends a post request to that page with87some JavaScript they just have to trick some users to load that page and88their profiles will end up being deleted.8990Imagine you were to run Facebook with millions of concurrent users and91someone would send out links to images of little kittens. When users92would go to that page, their profiles would get deleted while they are93looking at images of fluffy cats.9495How can you prevent that? Basically for each request that modifies96content on the server you would have to either use a one-time token and97store that in the cookie **and** also transmit it with the form data.98After receiving the data on the server again, you would then have to99compare the two tokens and ensure they are equal.100101Why does Flask not do that for you? The ideal place for this to happen is102the form validation framework, which does not exist in Flask.103104.. _security-json:105106JSON Security107-------------108109In Flask 0.10 and lower, :func:`~flask.jsonify` did not serialize top-level110arrays to JSON. This was because of a security vulnerability in ECMAScript 4.111112ECMAScript 5 closed this vulnerability, so only extremely old browsers are113still vulnerable. All of these browsers have `other more serious114vulnerabilities115<https://github.com/pallets/flask/issues/248#issuecomment-59934857>`_, so116this behavior was changed and :func:`~flask.jsonify` now supports serializing117arrays.118119Security Headers120----------------121122Browsers recognize various response headers in order to control security. We123recommend reviewing each of the headers below for use in your application.124The `Flask-Talisman`_ extension can be used to manage HTTPS and the security125headers for you.126127.. _Flask-Talisman: https://github.com/GoogleCloudPlatform/flask-talisman128129HTTP Strict Transport Security (HSTS)130~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~131132Tells the browser to convert all HTTP requests to HTTPS, preventing133man-in-the-middle (MITM) attacks. ::134135 response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'136137- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security138139.. _security-csp:140141Content Security Policy (CSP)142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~143144Tell the browser where it can load various types of resource from. This header145should be used whenever possible, but requires some work to define the correct146policy for your site. A very strict policy would be::147148 response.headers['Content-Security-Policy'] = "default-src 'self'"149150- https://csp.withgoogle.com/docs/index.html151- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy152153X-Content-Type-Options154~~~~~~~~~~~~~~~~~~~~~~155156Forces the browser to honor the response content type instead of trying to157detect it, which can be abused to generate a cross-site scripting (XSS)158attack. ::159160 response.headers['X-Content-Type-Options'] = 'nosniff'161162- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options163164X-Frame-Options165~~~~~~~~~~~~~~~166167Prevents external sites from embedding your site in an ``iframe``. This168prevents a class of attacks where clicks in the outer frame can be translated169invisibly to clicks on your page's elements. This is also known as170"clickjacking". ::171172 response.headers['X-Frame-Options'] = 'SAMEORIGIN'173174- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options175176.. _security-cookie:177178Set-Cookie options179~~~~~~~~~~~~~~~~~~180181These options can be added to a ``Set-Cookie`` header to improve their182security. Flask has configuration options to set these on the session cookie.183They can be set on other cookies too.184185- ``Secure`` limits cookies to HTTPS traffic only.186- ``HttpOnly`` protects the contents of cookies from being read with187 JavaScript.188- ``SameSite`` restricts how cookies are sent with requests from189 external sites. Can be set to ``'Lax'`` (recommended) or ``'Strict'``.190 ``Lax`` prevents sending cookies with CSRF-prone requests from191 external sites, such as submitting a form. ``Strict`` prevents sending192 cookies with all external requests, including following regular links.193194::195196 app.config.update(197 SESSION_COOKIE_SECURE=True,198 SESSION_COOKIE_HTTPONLY=True,199 SESSION_COOKIE_SAMESITE='Lax',200 )201202 response.set_cookie('username', 'flask', secure=True, httponly=True, samesite='Lax')203204Specifying ``Expires`` or ``Max-Age`` options, will remove the cookie after205the given time, or the current time plus the age, respectively. If neither206option is set, the cookie will be removed when the browser is closed. ::207208 # cookie expires after 10 minutes209 response.set_cookie('snakes', '3', max_age=600)210211For the session cookie, if :attr:`session.permanent <flask.session.permanent>`212is set, then :data:`PERMANENT_SESSION_LIFETIME` is used to set the expiration.213Flask's default cookie implementation validates that the cryptographic214signature is not older than this value. Lowering this value may help mitigate215replay attacks, where intercepted cookies can be sent at a later time. ::216217 app.config.update(218 PERMANENT_SESSION_LIFETIME=600219 )220221 @app.route('/login', methods=['POST'])222 def login():223 ...224 session.clear()225 session['user_id'] = user.id226 session.permanent = True227 ...228229Use :class:`itsdangerous.TimedSerializer` to sign and validate other cookie230values (or any values that need secure signatures).231232- https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies233- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie234235.. _samesite_support: https://caniuse.com/#feat=same-site-cookie-attribute236237238HTTP Public Key Pinning (HPKP)239~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~240241This tells the browser to authenticate with the server using only the specific242certificate key to prevent MITM attacks.243244.. warning::245 Be careful when enabling this, as it is very difficult to undo if you set up246 or upgrade your key incorrectly.247248- https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning249250251Copy/Paste to Terminal252----------------------253254Hidden characters such as the backspace character (``\b``, ``^H``) can255cause text to render differently in HTML than how it is interpreted if256`pasted into a terminal <https://security.stackexchange.com/q/39118>`__.257258For example, ``import y\bose\bm\bi\bt\be\b`` renders as259``import yosemite`` in HTML, but the backspaces are applied when pasted260into a terminal, and it becomes ``import os``.261262If you expect users to copy and paste untrusted code from your site,263such as from comments posted by users on a technical blog, consider264applying extra filtering, such as replacing all ``\b`` characters.265266.. code-block:: python267268 body = body.replace("\b", "")269270Most modern terminals will warn about and remove hidden characters when271pasting, so this isn't strictly necessary. It's also possible to craft272dangerous commands in other ways that aren't possible to filter.273Depending on your site's use case, it may be good to show a warning274about copying code in general.
modified:requirements/build.txt+3 added-3 removed
1#2# This file is autogenerated by pip-compile with Python 3.112# This file is autogenerated by pip-compile with Python 3.123# by the following command:4#5# pip-compile build.in6#7build==1.0.37build==1.2.18 # via -r build.in9packaging==23.29packaging==24.010 # via build11pyproject-hooks==1.0.012 # via build
modified:requirements/dev.in+3 added-4 removed
1-r docs.in2-r tests.in3-r typing.in4pip-tools1-r docs.txt2-r tests.txt3-r typing.txt4pre-commit5tox
modified:requirements/dev.txt+117 added-73 removed
1#2# This file is autogenerated by pip-compile with Python 3.112# This file is autogenerated by pip-compile with Python 3.123# by the following command:4#5# pip-compile dev.in6#7alabaster==0.7.168 # via sphinx9asgiref==3.7.28 # via9 # -r docs.txt10 # sphinx11asgiref==3.8.112 # via11 # -r tests.in12 # -r typing.in13 # -r tests.txt14 # -r typing.txt15babel==2.14.014 # via sphinx15build==1.0.316 # via pip-tools17cachetools==5.3.216 # via17 # -r docs.txt18 # sphinx19cachetools==5.3.320 # via tox19certifi==2023.11.1720 # via requests21certifi==2024.2.222 # via23 # -r docs.txt24 # requests25cffi==1.16.026 # via27 # -r typing.txt22 # via cryptography28 # cryptography29cfgv==3.4.030 # via pre-commit31chardet==5.2.032 # via tox33charset-normalizer==3.3.228 # via requests29click==8.1.730 # via pip-tools34 # via35 # -r docs.txt36 # requests37colorama==0.4.638 # via tox33cryptography==41.0.734 # via -r typing.in39cryptography==42.0.540 # via -r typing.txt41distlib==0.3.842 # via virtualenv37docutils==0.18.143docutils==0.20.144 # via45 # -r docs.txt46 # sphinx47 # sphinx-tabs41filelock==3.13.148filelock==3.13.349 # via50 # tox51 # virtualenv45identify==2.5.3352identify==2.5.3553 # via pre-commit54idna==3.648 # via requests55 # via56 # -r docs.txt57 # requests58imagesize==1.4.150 # via sphinx59 # via60 # -r docs.txt61 # sphinx62iniconfig==2.0.052 # via pytest63 # via64 # -r tests.txt65 # -r typing.txt66 # pytest67jinja2==3.1.354 # via sphinx55markupsafe==2.1.356 # via jinja257mypy==1.8.058 # via -r typing.in68 # via69 # -r docs.txt70 # sphinx71markupsafe==2.1.572 # via73 # -r docs.txt74 # jinja275mypy==1.9.076 # via -r typing.txt77mypy-extensions==1.0.060 # via mypy78 # via79 # -r typing.txt80 # mypy81nodeenv==1.8.062 # via pre-commit63packaging==23.282 # via65 # build83 # -r typing.txt84 # pre-commit85 # pyright86packaging==24.087 # via88 # -r docs.txt89 # -r tests.txt90 # -r typing.txt91 # pallets-sphinx-themes92 # pyproject-api93 # pytest94 # sphinx95 # tox96pallets-sphinx-themes==2.1.172 # via -r docs.in73pip-tools==7.3.074 # via -r dev.in75platformdirs==4.1.097 # via -r docs.txt98platformdirs==4.2.099 # via100 # tox101 # virtualenv79pluggy==1.3.0102pluggy==1.4.0103 # via104 # -r tests.txt105 # -r typing.txt106 # pytest107 # tox83pre-commit==3.6.0108pre-commit==3.7.0109 # via -r dev.in85pycparser==2.2186 # via cffi110pycparser==2.22111 # via112 # -r typing.txt113 # cffi114pygments==2.17.2115 # via116 # -r docs.txt117 # sphinx118 # sphinx-tabs119pyproject-api==1.6.1120 # via tox93pyproject-hooks==1.0.094 # via build95pytest==7.4.496 # via -r tests.in97python-dotenv==1.0.0121pyright==1.1.357122 # via -r typing.txt123pytest==8.1.1124 # via99 # -r tests.in100 # -r typing.in125 # -r tests.txt126 # -r typing.txt127python-dotenv==1.0.1128 # via129 # -r tests.txt130 # -r typing.txt131pyyaml==6.0.1132 # via pre-commit133requests==2.31.0104 # via sphinx134 # via135 # -r docs.txt136 # sphinx137snowballstemmer==2.2.0106 # via sphinx138 # via139 # -r docs.txt140 # sphinx141sphinx==7.2.6142 # via109 # -r docs.in143 # -r docs.txt144 # pallets-sphinx-themes111 # sphinx-issues145 # sphinx-tabs146 # sphinxcontrib-log-cabinet114sphinx-issues==3.0.1115 # via -r docs.in116sphinx-tabs==3.4.4117 # via -r docs.in147sphinx-tabs==3.4.5148 # via -r docs.txt149sphinxcontrib-applehelp==1.0.8119 # via sphinx150 # via151 # -r docs.txt152 # sphinx153sphinxcontrib-devhelp==1.0.6121 # via sphinx154 # via155 # -r docs.txt156 # sphinx157sphinxcontrib-htmlhelp==2.0.5123 # via sphinx158 # via159 # -r docs.txt160 # sphinx161sphinxcontrib-jsmath==1.0.1125 # via sphinx162 # via163 # -r docs.txt164 # sphinx165sphinxcontrib-log-cabinet==1.0.1127 # via -r docs.in166 # via -r docs.txt167sphinxcontrib-qthelp==1.0.7129 # via sphinx168 # via169 # -r docs.txt170 # sphinx171sphinxcontrib-serializinghtml==1.1.10172 # via173 # -r docs.txt131 # via sphinx132tox==4.12.0174 # sphinx175tox==4.14.2176 # via -r dev.in177types-contextvars==2.4.7.3135 # via -r typing.in178 # via -r typing.txt179types-dataclasses==0.6.6137 # via -r typing.in138typing-extensions==4.9.0139 # via mypy140urllib3==2.1.0141 # via requests142virtualenv==20.25.0180 # via -r typing.txt181typing-extensions==4.11.0182 # via183 # -r typing.txt184 # mypy185urllib3==2.2.1186 # via187 # -r docs.txt188 # requests189virtualenv==20.25.1190 # via191 # pre-commit192 # tox146wheel==0.42.0147 # via pip-tools193194# The following packages are considered to be unsafe in a requirements file:150# pip195# setuptools
modified:requirements/docs.in-1 removed
1pallets-sphinx-themes2sphinx3sphinx-issues3sphinxcontrib-log-cabinet4sphinx-tabs
modified:requirements/docs.txt+7 added-10 removed
1#2# This file is autogenerated by pip-compile with Python 3.112# This file is autogenerated by pip-compile with Python 3.123# by the following command:4#5# pip-compile docs.in6#7alabaster==0.7.168 # via sphinx9babel==2.14.010 # via sphinx11certifi==2023.11.1711certifi==2024.2.212 # via requests13charset-normalizer==3.3.214 # via requests15docutils==0.18.115docutils==0.20.116 # via17 # sphinx18 # sphinx-tabs19idna==3.6
1 unmodified line
21imagesize==1.4.122 # via sphinx23jinja2==3.1.324 # via sphinx25markupsafe==2.1.325markupsafe==2.1.526 # via jinja227packaging==23.227packaging==24.028 # via29 # pallets-sphinx-themes30 # sphinx31pallets-sphinx-themes==2.1.1
9 unmodified lines
41sphinx==7.2.642 # via43 # -r docs.in44 # pallets-sphinx-themes45 # sphinx-issues45 # sphinx-tabs46 # sphinxcontrib-log-cabinet48sphinx-issues==3.0.147sphinx-tabs==3.4.548 # via -r docs.in50sphinx-tabs==3.4.451 # via -r docs.in49sphinxcontrib-applehelp==1.0.850 # via sphinx51sphinxcontrib-devhelp==1.0.652 # via sphinx
6 unmodified lines
59sphinxcontrib-qthelp==1.0.760 # via sphinx61sphinxcontrib-serializinghtml==1.1.1062 # via sphinx66urllib3==2.1.063urllib3==2.2.164 # via requests
modified:requirements/tests.txt+6 added-6 removed
1#2# This file is autogenerated by pip-compile with Python 3.112# This file is autogenerated by pip-compile with Python 3.123# by the following command:4#5# pip-compile tests.in6#7asgiref==3.7.27asgiref==3.8.18 # via -r tests.in9iniconfig==2.0.010 # via pytest11packaging==23.211packaging==24.012 # via pytest13pluggy==1.3.013pluggy==1.4.014 # via pytest15pytest==7.4.415pytest==8.1.116 # via -r tests.in17python-dotenv==1.0.017python-dotenv==1.0.118 # via -r tests.in
modified:requirements/typing.in+2 added
1mypy2pyright3pytest4types-contextvars5types-dataclasses6asgiref7cryptography
1 unmodified line
modified:requirements/typing.txt+22 added-7 removed
1#2# This file is autogenerated by pip-compile with Python 3.112# This file is autogenerated by pip-compile with Python 3.123# by the following command:4#5# pip-compile typing.in6#7asgiref==3.7.27asgiref==3.8.18 # via -r typing.in9cffi==1.16.010 # via cryptography11cryptography==41.0.711cryptography==42.0.512 # via -r typing.in13iniconfig==2.0.014 # via pytest13mypy==1.8.015mypy==1.9.016 # via -r typing.in17mypy-extensions==1.0.018 # via mypy19nodeenv==1.8.020 # via pyright21packaging==24.022 # via pytest23pluggy==1.4.024 # via pytest17pycparser==2.2125pycparser==2.2226 # via cffi19python-dotenv==1.0.027pyright==1.1.35728 # via -r typing.in29pytest==8.1.130 # via -r typing.in31python-dotenv==1.0.132 # via -r typing.in33types-contextvars==2.4.7.334 # via -r typing.in35types-dataclasses==0.6.636 # via -r typing.in25typing-extensions==4.9.037typing-extensions==4.11.038 # via mypy3940# The following packages are considered to be unsafe in a requirements file:41# setuptools
modified:src/flask/json/tag.py+1 added
38 unmodified lines
39 return OrderedDict(value)4041 app.session_interface.serializer.register(TagOrderedDict, index=0)42"""4344from __future__ import annotations4546import typing as t47from base64 import b64decode
280 unmodified lines
modified:src/flask/cli.py+2 added-4 removed
227 unmodified lines
228229@t.overload230def locate_app(231 module_name: str, app_name: str | None, raise_if_not_found: t.Literal[True] = True232) -> Flask:233 ...232) -> Flask: ...233234235@t.overload236def locate_app(237 module_name: str, app_name: str | None, raise_if_not_found: t.Literal[False] = ...239) -> Flask | None:240 ...238) -> Flask | None: ...239240241def locate_app(242 module_name: str, app_name: str | None, raise_if_not_found: bool = True
867 unmodified lines
modified:src/flask/config.py+2 added-4 removed
25 unmodified lines
26 self.__name__ = name27 self.get_converter = get_converter2829 @t.overload30 def __get__(self, obj: None, owner: None) -> te.Self:31 ...30 def __get__(self, obj: None, owner: None) -> te.Self: ...3132 @t.overload34 def __get__(self, obj: App, owner: type[App]) -> T:35 ...33 def __get__(self, obj: App, owner: type[App]) -> T: ...3435 def __get__(self, obj: App | None, owner: type[App] | None = None) -> T | te.Self:36 if obj is None:37 return self
333 unmodified lines
modified:tests/typing/typing_app_decorators.py+4 added-8 removed
15 unmodified lines
16 return Response()171819@app.before_request20def before_sync() -> None:21 ...20def before_sync() -> None: ...212223@app.before_request25async def before_async() -> None:26 ...24async def before_async() -> None: ...252627@app.teardown_appcontext30def teardown_sync(exc: BaseException | None) -> None:31 ...28def teardown_sync(exc: BaseException | None) -> None: ...293031@app.teardown_appcontext35async def teardown_async(exc: BaseException | None) -> None:36 ...32async def teardown_async(exc: BaseException | None) -> None: ...
modified:tests/test_json.py+1 added-1 removed
174 unmodified lines
175176def test_jsonify_uuid_types(app, client):177 """Test jsonify with uuid.UUID types"""178179 test_uuid = uuid.UUID(bytes=b"\xDE\xAD\xBE\xEF" * 4)179 test_uuid = uuid.UUID(bytes=b"\xde\xad\xbe\xef" * 4)180 url = "/uuid_test"181 app.add_url_rule(url, url, lambda: flask.jsonify(x=test_uuid))182183 rv = client.get(url)
163 unmodified lines
modified:.editorconfig+1 added-1 removed
7 unmodified lines
8end_of_line = lf9charset = utf-810max_line_length = 881112[*.{yml,yaml,json,js,css,html}]12[*.{css,html,js,json,jsx,scss,ts,tsx,yaml,yml}]13indent_size = 2
modified:.gitignore+5 added-5 removed
1.idea/2.vscode/3.venv*/4venv*/5__pycache__/4.tox/5.coverage6.coverage.*6dist/7.coverage*8htmlcov/9.tox/10docs/_build/9dist/10venv/
modified:.pre-commit-config.yaml+2 added-2 removed
1ci:2 autoupdate_schedule: monthly3repos:4 - repo: https://github.com/astral-sh/ruff-pre-commit5 rev: v0.1.135 rev: v0.3.56 hooks:7 - id: ruff8 - id: ruff-format9 - repo: https://github.com/pre-commit/pre-commit-hooks10 rev: v4.5.010 rev: v4.6.011 hooks:12 - id: check-merge-conflict13 - id: debug-statements14 - id: fix-byte-order-marker
2 unmodified lines
modified:.readthedocs.yaml+1 added-1 removed
1version: 22build:3 os: ubuntu-22.044 tools:5 python: "3.12"5 python: '3.12'6python:7 install:8 - requirements: requirements/docs.txt9 - method: pip
4 unmodified lines
deleted:LICENSE.rst-28 removed
1Copyright 2010 Pallets23Redistribution and use in source and binary forms, with or without4modification, are permitted provided that the following conditions are5met:671. Redistributions of source code must retain the above copyright8 notice, this list of conditions and the following disclaimer.9102. Redistributions in binary form must reproduce the above copyright11 notice, this list of conditions and the following disclaimer in the12 documentation and/or other materials provided with the distribution.13143. Neither the name of the copyright holder nor the names of its15 contributors may be used to endorse or promote products derived from16 this software without specific prior written permission.1718THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
added:LICENSE.txt+28 added
1Copyright 2010 Pallets23Redistribution and use in source and binary forms, with or without4modification, are permitted provided that the following conditions are5met:671. Redistributions of source code must retain the above copyright8 notice, this list of conditions and the following disclaimer.9102. Redistributions in binary form must reproduce the above copyright11 notice, this list of conditions and the following disclaimer in the12 documentation and/or other materials provided with the distribution.13143. Neither the name of the copyright holder nor the names of its15 contributors may be used to endorse or promote products derived from16 this software without specific prior written permission.1718THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
modified:pyproject.toml+10 added-5 removed
1[project]2name = "Flask"3version = "3.0.2"4description = "A simple framework for building complex web applications."5readme = "README.rst"6license = {file = "LICENSE.rst"}5readme = "README.md"6license = {file = "LICENSE.txt"}7maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]8classifiers = [9 "Development Status :: 5 - Production/Stable",10 "Environment :: Web Environment",
5 unmodified lines
16 "Topic :: Internet :: WWW/HTTP :: Dynamic Content",17 "Topic :: Internet :: WWW/HTTP :: WSGI",18 "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",19 "Topic :: Software Development :: Libraries :: Application Frameworks",20 "Typing :: Typed",21]22requires-python = ">=3.8"23dependencies = [24 "Werkzeug>=3.0.0",
7 unmodified lines
32[project.urls]33Donate = "https://palletsprojects.com/donate"34Documentation = "https://flask.palletsprojects.com/"35Changes = "https://flask.palletsprojects.com/changes/"35"Source Code" = "https://github.com/pallets/flask/"36"Issue Tracker" = "https://github.com/pallets/flask/issues/"36Source = "https://github.com/pallets/flask/"37Chat = "https://discord.gg/pallets"3839[project.optional-dependencies]40async = ["asgiref>=3.2"]
51 unmodified lines
92 "importlib_metadata",93]94ignore_missing_imports = true9596[tool.pyright]97pythonVersion = "3.8"98include = ["src/flask", "tests"]99typeCheckingMode = "basic"100101[tool.ruff]102src = ["src"]103fix = true104show-fixes = true100show-source = true105output-format = "full"106107[tool.ruff.lint]108select = [109 "B", # flake8-bugbear
11 unmodified lines
added:README.md+65 added
1# Flask23Flask is a lightweight [WSGI][] web application framework. It is designed4to make getting started quick and easy, with the ability to scale up to5complex applications. It began as a simple wrapper around [Werkzeug][]6and [Jinja][], and has become one of the most popular Python web7application frameworks.89Flask offers suggestions, but doesn't enforce any dependencies or10project layout. It is up to the developer to choose the tools and11libraries they want to use. There are many extensions provided by the12community that make adding new functionality easy.1314[WSGI]: https://wsgi.readthedocs.io/15[Werkzeug]: https://werkzeug.palletsprojects.com/16[Jinja]: https://jinja.palletsprojects.com/171819## Installing2021Install and update from [PyPI][] using an installer such as [pip][]:2223```24$ pip install -U Flask25```2627[PyPI]: https://pypi.org/project/Flask/28[pip]: https://pip.pypa.io/en/stable/getting-started/293031## A Simple Example3233```python34# save this as app.py35from flask import Flask3637app = Flask(__name__)3839@app.route("/")40def hello():41 return "Hello, World!"42```4344```45$ flask run46 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)47```484950## Contributing5152For guidance on setting up a development environment and how to make a53contribution to Flask, see the [contributing guidelines][].5455[contributing guidelines]: https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst565758## Donate5960The Pallets organization develops and supports Flask and the libraries61it uses. In order to grow the community of contributors and users, and62allow the maintainers to devote more time to the projects, [please63donate today][].6465[please donate today]: https://palletsprojects.com/donate
deleted:README.rst-80 removed
1Flask2=====34Flask is a lightweight `WSGI`_ web application framework. It is designed5to make getting started quick and easy, with the ability to scale up to6complex applications. It began as a simple wrapper around `Werkzeug`_7and `Jinja`_ and has become one of the most popular Python web8application frameworks.910Flask offers suggestions, but doesn't enforce any dependencies or11project layout. It is up to the developer to choose the tools and12libraries they want to use. There are many extensions provided by the13community that make adding new functionality easy.1415.. _WSGI: https://wsgi.readthedocs.io/16.. _Werkzeug: https://werkzeug.palletsprojects.com/17.. _Jinja: https://jinja.palletsprojects.com/181920Installing21----------2223Install and update using `pip`_:2425.. code-block:: text2627 $ pip install -U Flask2829.. _pip: https://pip.pypa.io/en/stable/getting-started/303132A Simple Example33----------------3435.. code-block:: python3637 # save this as app.py38 from flask import Flask3940 app = Flask(__name__)4142 @app.route("/")43 def hello():44 return "Hello, World!"4546.. code-block:: text4748 $ flask run49 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)505152Contributing53------------5455For guidance on setting up a development environment and how to make a56contribution to Flask, see the `contributing guidelines`_.5758.. _contributing guidelines: https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst596061Donate62------6364The Pallets organization develops and supports Flask and the libraries65it uses. In order to grow the community of contributors and users, and66allow the maintainers to devote more time to the projects, `please67donate today`_.6869.. _please donate today: https://palletsprojects.com/donate707172Links73-----7475- Documentation: https://flask.palletsprojects.com/76- Changes: https://flask.palletsprojects.com/changes/77- PyPI Releases: https://pypi.org/project/Flask/78- Source Code: https://github.com/pallets/flask/79- Issue Tracker: https://github.com/pallets/flask/issues/80- Chat: https://discord.gg/pallets
modified:tox.ini+17 added-3 removed
1[tox]2envlist =3 py3{12,11,10,9,8}4 pypy3105 py311-min5 py312-min6 py38-dev7 style8 typing9 docs
8 unmodified lines
18deps =19 -r requirements/tests.txt20 min: -r requirements-skip/tests-min.txt21 dev: -r requirements-skip/tests-dev.txt22commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs:tests}22commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}2324[testenv:style]25deps = pre-commit26skip_install = true
4 unmodified lines
31commands = mypy3233[testenv:docs]34deps = -r requirements/docs.txt35commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html35commands = sphinx-build -W -b dirhtml docs docs/_build/dirhtml3637[testenv:update-requirements]38deps =39 pip-tools40 pre-commit41skip_install = true42change_dir = requirements43commands =44 pre-commit autoupdate -j445 pip-compile -U build.in46 pip-compile -U docs.in47 pip-compile -U tests.in48 pip-compile -U typing.in49 pip-compile -U dev.in