Skip to content

Commit

Permalink
Merge branch '2.0.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Feb 9, 2022
2 parents bc094db + d6496c8 commit e37e871
Show file tree
Hide file tree
Showing 23 changed files with 221 additions and 180 deletions.
10 changes: 0 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/requirements"
target-branch: "2.0.x"
versioning-strategy: "lockfile-only"
schedule:
interval: "monthly"
day: "monday"
time: "16:00"
timezone: "UTC"
open-pull-requests-limit: 99
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,12 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
- run: pip install tox
- run: tox -e ${{ matrix.tox }}
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ repos:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
rev: v2.7.1
hooks:
- id: reorder-python-imports
name: Reorder Python imports (src, tests)
files: "^(?!examples/)"
args: ["--application-directories", "src"]
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand All @@ -25,6 +25,10 @@ repos:
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/peterdemin/pip-compile-multi
rev: v2.4.3
hooks:
- id: pip-compile-multi-verify
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
Expand Down
53 changes: 53 additions & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ environment variable is used to specify how to load the application.
$ export FLASK_APP=hello
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP hello
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -156,6 +163,20 @@ reloader.
* Debugger is active!
* Debugger PIN: 223-456-919
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_ENV development
$ flask run
* Serving Flask app "hello"
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with inotify reloader
* Debugger is active!
* Debugger PIN: 223-456-919
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -207,6 +228,17 @@ separated with ``:``, or ``;`` on Windows.
* Running on http://127.0.0.1:8000/
* Detected change in '/path/to/file1', reloading
.. group-tab:: Fish

.. code-block:: text
$ flask run --extra-files file1:dirA/file2:dirB/
# or
$ set -x FLASK_RUN_EXTRA_FILES file1 dirA/file2 dirB/
$ flask run
* Running on http://127.0.0.1:8000/
* Detected change in '/path/to/file1', reloading
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -287,6 +319,14 @@ command, instead of ``flask run --port 8000``:
$ flask run
* Running on http://127.0.0.1:8000/
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_RUN_PORT 8000
$ flask run
* Running on http://127.0.0.1:8000/
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -334,6 +374,13 @@ configure as expected.
$ export FLASK_SKIP_DOTENV=1
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_SKIP_DOTENV 1
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -364,6 +411,12 @@ script. Activating the virtualenv will set the variables.

$ export FLASK_APP=hello

.. group-tab:: Fish

Fish, :file:`venv/bin/activate.fish`::

$ set -x FLASK_APP hello

.. group-tab:: CMD

Windows CMD, :file:`venv\\Scripts\\activate.bat`::
Expand Down
24 changes: 24 additions & 0 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ set :envvar:`FLASK_ENV`:
$ export FLASK_ENV=development
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_ENV development
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -445,6 +452,14 @@ in the shell before starting the server:
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: Fish

.. code-block:: text
$ set -x YOURAPPLICATION_SETTINGS /path/to/settings.cfg
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -517,6 +532,15 @@ Environment variables can be set in the shell before starting the server:
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: Fish

.. code-block:: text
$ set -x SECRET_KEY "5f352379324c22463451387a0aec5d2f"
$ set -x MAIL_ENABLED false
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: CMD

.. code-block:: text
Expand Down
14 changes: 14 additions & 0 deletions docs/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ enables the debugger and reloader.
$ export FLASK_ENV=development
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_ENV development
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -106,6 +113,13 @@ When running from the command line:
$ export FLASK_ENV=development
$ flask run --no-debugger --no-reload
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_ENV development
$ flask run --no-debugger --no-reload
.. group-tab:: CMD

.. code-block:: text
Expand Down
14 changes: 14 additions & 0 deletions docs/patterns/appfactories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ To run such an application, you can use the :command:`flask` command:
$ export FLASK_APP=myapp
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP myapp
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand All @@ -124,6 +131,13 @@ in ``myapp``. You can also pass arguments to the factory like this:
$ export FLASK_APP="myapp:create_app('dev')"
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP "myapp:create_app('dev')"
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down
12 changes: 12 additions & 0 deletions docs/patterns/packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ that tells Flask where to find the application instance:
$ export FLASK_APP=yourapplication
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP yourapplication
.. group-tab:: CMD

.. code-block:: text
Expand All @@ -91,6 +97,12 @@ development features like this:
$ export FLASK_ENV=development
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_ENV development
.. group-tab:: CMD

.. code-block:: text
Expand Down
15 changes: 15 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ to tell your terminal the application to work with by exporting the
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP hello
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: CMD

.. code-block:: text
Expand Down Expand Up @@ -166,6 +174,13 @@ variable to ``development`` before calling ``flask run``.
$ export FLASK_ENV=development
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_ENV development
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down
12 changes: 0 additions & 12 deletions docs/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,6 @@ invisibly to clicks on your page's elements. This is also known as

- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

X-XSS-Protection
~~~~~~~~~~~~~~~~

The browser will try to prevent reflected XSS attacks by not loading the page
if the request contains something that looks like JavaScript and the response
contains the same data. ::

response.headers['X-XSS-Protection'] = '1; mode=block'

- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection


.. _security-cookie:

Set-Cookie options
Expand Down
8 changes: 8 additions & 0 deletions docs/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ fully enable development mode.
$ export FLASK_ENV=development
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP hello
$ export FLASK_ENV=development
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down
7 changes: 7 additions & 0 deletions docs/tutorial/deploy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ create the database in the instance folder.
$ export FLASK_APP=flaskr
$ flask init-db
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP flaskr
$ flask init-db
.. group-tab:: CMD

.. code-block:: text
Expand Down
8 changes: 8 additions & 0 deletions docs/tutorial/factory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ follow the tutorial.
$ export FLASK_ENV=development
$ flask run
.. group-tab:: Fish

.. code-block:: text
$ set -x FLASK_APP flaskr
$ set -x FLASK_ENV development
$ flask run
.. group-tab:: CMD

.. code-block:: text
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r docs.in
-r tests.in
-r typing.in
pip-tools
pip-compile-multi
pre-commit
tox
Loading

0 comments on commit e37e871

Please sign in to comment.