Skip to content

Commit e37e871

Browse files
committed
Merge branch '2.0.x'
2 parents bc094db + d6496c8 commit e37e871

23 files changed

+221
-180
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "pip"
4-
directory: "/requirements"
5-
target-branch: "2.0.x"
6-
versioning-strategy: "lockfile-only"
7-
schedule:
8-
interval: "monthly"
9-
day: "monday"
10-
time: "16:00"
11-
timezone: "UTC"
12-
open-pull-requests-limit: 99
133
- package-ecosystem: "github-actions"
144
directory: "/"
155
schedule:

.github/workflows/tests.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,12 @@ jobs:
4040
- uses: actions/setup-python@v2
4141
with:
4242
python-version: ${{ matrix.python }}
43+
cache: 'pip'
44+
cache-dependency-path: 'requirements/*.txt'
4345
- name: update pip
4446
run: |
4547
pip install -U wheel
4648
pip install -U setuptools
4749
python -m pip install -U pip
48-
- name: get pip cache dir
49-
id: pip-cache
50-
run: echo "::set-output name=dir::$(pip cache dir)"
51-
- name: cache pip
52-
uses: actions/cache@v2
53-
with:
54-
path: ${{ steps.pip-cache.outputs.dir }}
55-
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
5650
- run: pip install tox
5751
- run: tox -e ${{ matrix.tox }}

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ repos:
88
- id: pyupgrade
99
args: ["--py36-plus"]
1010
- repo: https://github.com/asottile/reorder_python_imports
11-
rev: v2.6.0
11+
rev: v2.7.1
1212
hooks:
1313
- id: reorder-python-imports
1414
name: Reorder Python imports (src, tests)
1515
files: "^(?!examples/)"
1616
args: ["--application-directories", "src"]
1717
- repo: https://github.com/psf/black
18-
rev: 21.12b0
18+
rev: 22.1.0
1919
hooks:
2020
- id: black
2121
- repo: https://github.com/PyCQA/flake8
@@ -25,6 +25,10 @@ repos:
2525
additional_dependencies:
2626
- flake8-bugbear
2727
- flake8-implicit-str-concat
28+
- repo: https://github.com/peterdemin/pip-compile-multi
29+
rev: v2.4.3
30+
hooks:
31+
- id: pip-compile-multi-verify
2832
- repo: https://github.com/pre-commit/pre-commit-hooks
2933
rev: v4.1.0
3034
hooks:

docs/cli.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ environment variable is used to specify how to load the application.
2727
$ export FLASK_APP=hello
2828
$ flask run
2929
30+
.. group-tab:: Fish
31+
32+
.. code-block:: text
33+
34+
$ set -x FLASK_APP hello
35+
$ flask run
36+
3037
.. group-tab:: CMD
3138

3239
.. code-block:: text
@@ -156,6 +163,20 @@ reloader.
156163
* Debugger is active!
157164
* Debugger PIN: 223-456-919
158165
166+
.. group-tab:: Fish
167+
168+
.. code-block:: text
169+
170+
$ set -x FLASK_ENV development
171+
$ flask run
172+
* Serving Flask app "hello"
173+
* Environment: development
174+
* Debug mode: on
175+
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
176+
* Restarting with inotify reloader
177+
* Debugger is active!
178+
* Debugger PIN: 223-456-919
179+
159180
.. group-tab:: CMD
160181

161182
.. code-block:: text
@@ -207,6 +228,17 @@ separated with ``:``, or ``;`` on Windows.
207228
* Running on http://127.0.0.1:8000/
208229
* Detected change in '/path/to/file1', reloading
209230
231+
.. group-tab:: Fish
232+
233+
.. code-block:: text
234+
235+
$ flask run --extra-files file1:dirA/file2:dirB/
236+
# or
237+
$ set -x FLASK_RUN_EXTRA_FILES file1 dirA/file2 dirB/
238+
$ flask run
239+
* Running on http://127.0.0.1:8000/
240+
* Detected change in '/path/to/file1', reloading
241+
210242
.. group-tab:: CMD
211243

212244
.. code-block:: text
@@ -287,6 +319,14 @@ command, instead of ``flask run --port 8000``:
287319
$ flask run
288320
* Running on http://127.0.0.1:8000/
289321
322+
.. group-tab:: Fish
323+
324+
.. code-block:: text
325+
326+
$ set -x FLASK_RUN_PORT 8000
327+
$ flask run
328+
* Running on http://127.0.0.1:8000/
329+
290330
.. group-tab:: CMD
291331

292332
.. code-block:: text
@@ -334,6 +374,13 @@ configure as expected.
334374
$ export FLASK_SKIP_DOTENV=1
335375
$ flask run
336376
377+
.. group-tab:: Fish
378+
379+
.. code-block:: text
380+
381+
$ set -x FLASK_SKIP_DOTENV 1
382+
$ flask run
383+
337384
.. group-tab:: CMD
338385

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

365412
$ export FLASK_APP=hello
366413

414+
.. group-tab:: Fish
415+
416+
Fish, :file:`venv/bin/activate.fish`::
417+
418+
$ set -x FLASK_APP hello
419+
367420
.. group-tab:: CMD
368421

369422
Windows CMD, :file:`venv\\Scripts\\activate.bat`::

docs/config.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ set :envvar:`FLASK_ENV`:
7676
$ export FLASK_ENV=development
7777
$ flask run
7878
79+
.. group-tab:: Fish
80+
81+
.. code-block:: text
82+
83+
$ set -x FLASK_ENV development
84+
$ flask run
85+
7986
.. group-tab:: CMD
8087

8188
.. code-block:: text
@@ -445,6 +452,14 @@ in the shell before starting the server:
445452
$ flask run
446453
* Running on http://127.0.0.1:5000/
447454
455+
.. group-tab:: Fish
456+
457+
.. code-block:: text
458+
459+
$ set -x YOURAPPLICATION_SETTINGS /path/to/settings.cfg
460+
$ flask run
461+
* Running on http://127.0.0.1:5000/
462+
448463
.. group-tab:: CMD
449464

450465
.. code-block:: text
@@ -517,6 +532,15 @@ Environment variables can be set in the shell before starting the server:
517532
$ flask run
518533
* Running on http://127.0.0.1:5000/
519534
535+
.. group-tab:: Fish
536+
537+
.. code-block:: text
538+
539+
$ set -x SECRET_KEY "5f352379324c22463451387a0aec5d2f"
540+
$ set -x MAIL_ENABLED false
541+
$ flask run
542+
* Running on http://127.0.0.1:5000/
543+
520544
.. group-tab:: CMD
521545

522546
.. code-block:: text

docs/debugging.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ enables the debugger and reloader.
5353
$ export FLASK_ENV=development
5454
$ flask run
5555
56+
.. group-tab:: Fish
57+
58+
.. code-block:: text
59+
60+
$ set -x FLASK_ENV development
61+
$ flask run
62+
5663
.. group-tab:: CMD
5764

5865
.. code-block:: text
@@ -106,6 +113,13 @@ When running from the command line:
106113
$ export FLASK_ENV=development
107114
$ flask run --no-debugger --no-reload
108115
116+
.. group-tab:: Fish
117+
118+
.. code-block:: text
119+
120+
$ set -x FLASK_ENV development
121+
$ flask run --no-debugger --no-reload
122+
109123
.. group-tab:: CMD
110124

111125
.. code-block:: text

docs/patterns/appfactories.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ To run such an application, you can use the :command:`flask` command:
9898
$ export FLASK_APP=myapp
9999
$ flask run
100100
101+
.. group-tab:: Fish
102+
103+
.. code-block:: text
104+
105+
$ set -x FLASK_APP myapp
106+
$ flask run
107+
101108
.. group-tab:: CMD
102109

103110
.. code-block:: text
@@ -124,6 +131,13 @@ in ``myapp``. You can also pass arguments to the factory like this:
124131
$ export FLASK_APP="myapp:create_app('dev')"
125132
$ flask run
126133
134+
.. group-tab:: Fish
135+
136+
.. code-block:: text
137+
138+
$ set -x FLASK_APP "myapp:create_app('dev')"
139+
$ flask run
140+
127141
.. group-tab:: CMD
128142

129143
.. code-block:: text

docs/patterns/packages.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ that tells Flask where to find the application instance:
6767
6868
$ export FLASK_APP=yourapplication
6969
70+
.. group-tab:: Fish
71+
72+
.. code-block:: text
73+
74+
$ set -x FLASK_APP yourapplication
75+
7076
.. group-tab:: CMD
7177

7278
.. code-block:: text
@@ -91,6 +97,12 @@ development features like this:
9197
9298
$ export FLASK_ENV=development
9399
100+
.. group-tab:: Fish
101+
102+
.. code-block:: text
103+
104+
$ set -x FLASK_ENV development
105+
94106
.. group-tab:: CMD
95107

96108
.. code-block:: text

docs/quickstart.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ to tell your terminal the application to work with by exporting the
5454
$ flask run
5555
* Running on http://127.0.0.1:5000/
5656
57+
.. group-tab:: Fish
58+
59+
.. code-block:: text
60+
61+
$ set -x FLASK_APP hello
62+
$ flask run
63+
* Running on http://127.0.0.1:5000/
64+
5765
.. group-tab:: CMD
5866

5967
.. code-block:: text
@@ -166,6 +174,13 @@ variable to ``development`` before calling ``flask run``.
166174
$ export FLASK_ENV=development
167175
$ flask run
168176
177+
.. group-tab:: Fish
178+
179+
.. code-block:: text
180+
181+
$ set -x FLASK_ENV development
182+
$ flask run
183+
169184
.. group-tab:: CMD
170185

171186
.. code-block:: text

docs/security.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,6 @@ invisibly to clicks on your page's elements. This is also known as
173173

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

176-
X-XSS-Protection
177-
~~~~~~~~~~~~~~~~
178-
179-
The browser will try to prevent reflected XSS attacks by not loading the page
180-
if the request contains something that looks like JavaScript and the response
181-
contains the same data. ::
182-
183-
response.headers['X-XSS-Protection'] = '1; mode=block'
184-
185-
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
186-
187-
188176
.. _security-cookie:
189177

190178
Set-Cookie options

docs/server.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ fully enable development mode.
3333
$ export FLASK_ENV=development
3434
$ flask run
3535
36+
.. group-tab:: Fish
37+
38+
.. code-block:: text
39+
40+
$ set -x FLASK_APP hello
41+
$ export FLASK_ENV=development
42+
$ flask run
43+
3644
.. group-tab:: CMD
3745

3846
.. code-block:: text

docs/tutorial/deploy.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ create the database in the instance folder.
5757
$ export FLASK_APP=flaskr
5858
$ flask init-db
5959
60+
.. group-tab:: Fish
61+
62+
.. code-block:: text
63+
64+
$ set -x FLASK_APP flaskr
65+
$ flask init-db
66+
6067
.. group-tab:: CMD
6168

6269
.. code-block:: text

docs/tutorial/factory.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ follow the tutorial.
145145
$ export FLASK_ENV=development
146146
$ flask run
147147
148+
.. group-tab:: Fish
149+
150+
.. code-block:: text
151+
152+
$ set -x FLASK_APP flaskr
153+
$ set -x FLASK_ENV development
154+
$ flask run
155+
148156
.. group-tab:: CMD
149157

150158
.. code-block:: text

requirements/dev.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r docs.in
22
-r tests.in
33
-r typing.in
4-
pip-tools
4+
pip-compile-multi
55
pre-commit
66
tox

0 commit comments

Comments
 (0)