Skip to content

Commit bc7dae3

Browse files
committed
Merge branch 'master' into AvivC-improve-docs-in-Flask.preprocess_request
2 parents 826d747 + 970a800 commit bc7dae3

File tree

156 files changed

+3333
-2065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+3333
-2065
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGES merge=union

.github/ISSUE_TEMPLATE.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The issue tracker is a tool to address bugs.
2+
Please use the #pocoo IRC channel on freenode or Stack Overflow for questions.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ _mailinglist
1111
.tox
1212
.cache/
1313
.idea/
14+
15+
# Coverage reports
16+
htmlcov
17+
.coverage
18+
.coverage.*
19+
*,cover

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,35 @@ python:
88
- "3.3"
99
- "3.4"
1010
- "3.5"
11+
- "3.6"
1112

1213
env:
1314
- REQUIREMENTS=lowest
15+
- REQUIREMENTS=lowest-simplejson
1416
- REQUIREMENTS=release
17+
- REQUIREMENTS=release-simplejson
1518
- REQUIREMENTS=devel
19+
- REQUIREMENTS=devel-simplejson
1620

1721
matrix:
1822
exclude:
1923
# Python 3 support currently does not work with lowest requirements
2024
- python: "3.3"
2125
env: REQUIREMENTS=lowest
26+
- python: "3.3"
27+
env: REQUIREMENTS=lowest-simplejson
2228
- python: "3.4"
2329
env: REQUIREMENTS=lowest
30+
- python: "3.4"
31+
env: REQUIREMENTS=lowest-simplejson
2432
- python: "3.5"
2533
env: REQUIREMENTS=lowest
26-
34+
- python: "3.5"
35+
env: REQUIREMENTS=lowest-simplejson
36+
- python: "3.6"
37+
env: REQUIREMENTS=lowest
38+
- python: "3.6"
39+
env: REQUIREMENTS=lowest-simplejson
2740

2841
install:
2942
- pip install tox

AUTHORS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ Patches and Suggestions
1515
- Chris Grindstaff
1616
- Christopher Grebs
1717
- Daniel Neuhäuser
18+
- Dan Sully
19+
- David Lord @davidism
1820
- Edmond Burnett
1921
- Florent Xicluna
2022
- Georg Brandl
23+
- Jeff Widman @jeffwidman
24+
- Joshua Bronson @jab
2125
- Justin Quick
2226
- Kenneth Reitz
2327
- Keyan Pishdadian
@@ -32,4 +36,3 @@ Patches and Suggestions
3236
- Stephane Wirtel
3337
- Thomas Schranz
3438
- Zhao Xiaohong
35-
- David Lord @davidism

CHANGES

Lines changed: 104 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,103 @@ Flask Changelog
33

44
Here you can see the full list of changes between each Flask release.
55

6-
Version 1.0
7-
-----------
6+
Version 0.13
7+
------------
8+
9+
Major release, unreleased
10+
11+
- Make `app.run()` into a noop if a Flask application is run from the
12+
development server on the command line. This avoids some behavior that
13+
was confusing to debug for newcomers.
14+
- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()
15+
method returns compressed response by default, and pretty response in
16+
debug mode.
17+
- Change Flask.__init__ to accept two new keyword arguments, ``host_matching``
18+
and ``static_host``. This enables ``host_matching`` to be set properly by the
19+
time the constructor adds the static route, and enables the static route to
20+
be properly associated with the required host. (``#1559``)
21+
- ``send_file`` supports Unicode in ``attachment_filename``. (`#2223`_)
22+
- Pass ``_scheme`` argument from ``url_for`` to ``handle_build_error``.
23+
(`#2017`_)
24+
- Add support for ``provide_automatic_options`` in ``add_url_rule`` to disable
25+
adding OPTIONS method when the ``view_func`` argument is not a class.
26+
(`#1489`_).
27+
- ``MethodView`` can inherit method handlers from base classes. (`#1936`_)
28+
- Errors caused while opening the session at the beginning of the request are
29+
handled by the app's error handlers. (`#2254`_)
30+
- Blueprints gained ``json_encoder`` and ``json_decoder`` attributes to
31+
override the app's encoder and decoder. (`#1898`_)
32+
- ``Flask.make_response`` raises ``TypeError`` instead of ``ValueError`` for
33+
bad response types. The error messages have been improved to describe why the
34+
type is invalid. (`#2256`_)
35+
36+
.. _#1489: https://github.com/pallets/flask/pull/1489
37+
.. _#1898: https://github.com/pallets/flask/pull/1898
38+
.. _#1936: https://github.com/pallets/flask/pull/1936
39+
.. _#2017: https://github.com/pallets/flask/pull/2017
40+
.. _#2223: https://github.com/pallets/flask/pull/2223
41+
.. _#2254: https://github.com/pallets/flask/pull/2254
42+
.. _#2256: https://github.com/pallets/flask/pull/2256
43+
44+
Version 0.12.1
45+
--------------
46+
47+
Bugfix release, released on March 31st 2017
48+
49+
- Prevent `flask run` from showing a NoAppException when an ImportError occurs
50+
within the imported application module.
51+
- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix
52+
``#2118``.
53+
- Use the ``SERVER_NAME`` config if it is present as default values for
54+
``app.run``. ``#2109``, ``#2152``
55+
- Call `ctx.auto_pop` with the exception object instead of `None`, in the
56+
event that a `BaseException` such as `KeyboardInterrupt` is raised in a
57+
request handler.
58+
59+
Version 0.12
60+
------------
61+
62+
Released on December 21st 2016, codename Punsch.
63+
64+
- the cli command now responds to `--version`.
65+
- Mimetype guessing and ETag generation for file-like objects in ``send_file``
66+
has been removed, as per issue ``#104``. See pull request ``#1849``.
67+
- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall back to
68+
``application/octet-stream``. See pull request ``#1988``.
69+
- Make ``flask.safe_join`` able to join multiple paths like ``os.path.join``
70+
(pull request ``#1730``).
71+
- Revert a behavior change that made the dev server crash instead of returning
72+
a Internal Server Error (pull request ``#2006``).
73+
- Correctly invoke response handlers for both regular request dispatching as
74+
well as error handlers.
75+
- Disable logger propagation by default for the app logger.
76+
- Add support for range requests in ``send_file``.
77+
- ``app.test_client`` includes preset default environment, which can now be
78+
directly set, instead of per ``client.get``.
79+
80+
Version 0.11.2
81+
--------------
82+
83+
Bugfix release, unreleased
84+
85+
- Fix crash when running under PyPy3, see pull request ``#1814``.
86+
87+
Version 0.11.1
88+
--------------
89+
90+
Bugfix release, released on June 7th 2016.
91+
92+
- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from working. See
93+
pull request ``#1872``.
94+
95+
Version 0.11
96+
------------
897

9-
(release date to be announced, codename to be selected)
98+
Released on May 29th 2016, codename Absinthe.
1099

100+
- Added support to serializing top-level arrays to :func:`flask.jsonify`. This
101+
introduces a security risk in ancient browsers. See
102+
:ref:`json-security` for details.
11103
- Added before_render_template signal.
12104
- Added `**kwargs` to :meth:`flask.Test.test_client` to support passing
13105
additional keyword arguments to the constructor of
@@ -23,7 +115,7 @@ Version 1.0
23115
from a view function.
24116
- Added :meth:`flask.Config.from_json`.
25117
- Added :attr:`flask.Flask.config_class`.
26-
- Added :meth:`flask.config.Config.get_namespace`.
118+
- Added :meth:`flask.Config.get_namespace`.
27119
- Templates are no longer automatically reloaded outside of debug mode. This
28120
can be configured with the new ``TEMPLATES_AUTO_RELOAD`` config key.
29121
- Added a workaround for a limitation in Python 3.3's namespace loader.
@@ -57,7 +149,7 @@ Version 1.0
57149
- JSON responses are now terminated with a newline character, because it is a
58150
convention that UNIX text files end with a newline and some clients don't
59151
deal well when this newline is missing. See
60-
https://github.com/mitsuhiko/flask/pull/1262 -- this came up originally as a
152+
https://github.com/pallets/flask/pull/1262 -- this came up originally as a
61153
part of https://github.com/kennethreitz/httpbin/issues/168
62154
- The automatically provided ``OPTIONS`` method is now correctly disabled if
63155
the user registered an overriding rule with the lowercase-version
@@ -70,6 +162,12 @@ Version 1.0
70162
- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.
71163
- Turn on autoescape for ``flask.templating.render_template_string`` by default
72164
(pull request ``#1515``).
165+
- ``flask.ext`` is now deprecated (pull request ``#1484``).
166+
- ``send_from_directory`` now raises BadRequest if the filename is invalid on
167+
the server OS (pull request ``#1763``).
168+
- Added the ``JSONIFY_MIMETYPE`` configuration variable (pull request ``#1728``).
169+
- Exceptions during teardown handling will no longer leave bad application
170+
contexts lingering around.
73171

74172
Version 0.10.2
75173
--------------
@@ -292,7 +390,7 @@ Released on September 29th 2011, codename Rakija
292390
- Applications now not only have a root path where the resources and modules
293391
are located but also an instance path which is the designated place to
294392
drop files that are modified at runtime (uploads etc.). Also this is
295-
conceptionally only instance depending and outside version control so it's
393+
conceptually only instance depending and outside version control so it's
296394
the perfect place to put configuration files etc. For more information
297395
see :ref:`instance-folders`.
298396
- Added the ``APPLICATION_ROOT`` configuration variable.

CONTRIBUTING.rst

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Support questions
1010
Please, don't use the issue tracker for this. Check whether the ``#pocoo`` IRC
1111
channel on Freenode can help with your issue. If your problem is not strictly
1212
Werkzeug or Flask specific, ``#python`` is generally more active.
13-
`StackOverflow <https://stackoverflow.com/>`_ is also worth considering.
13+
`Stack Overflow <https://stackoverflow.com/>`_ is also worth considering.
1414

1515
Reporting issues
1616
================
@@ -28,24 +28,24 @@ Submitting patches
2828
clearly under which circumstances the bug happens. Make sure the test fails
2929
without your patch.
3030

31-
- Try to follow `PEP8 <http://legacy.python.org/dev/peps/pep-0008/>`_, but you
31+
- Try to follow `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_, but you
3232
may ignore the line-length-limit if following it would make the code uglier.
3333

3434

3535
Running the testsuite
3636
---------------------
3737

3838
You probably want to set up a `virtualenv
39-
<http://virtualenv.readthedocs.org/en/latest/index.html>`_.
39+
<https://virtualenv.readthedocs.io/en/latest/index.html>`_.
4040

41-
The minimal requirement for running the testsuite is ``py.test``. You can
41+
The minimal requirement for running the testsuite is ``pytest``. You can
4242
install it with::
4343

4444
pip install pytest
4545

4646
Clone this repository::
4747

48-
git clone https://github.com/mitsuhiko/flask.git
48+
git clone https://github.com/pallets/flask.git
4949

5050
Install Flask as an editable package using the current source::
5151

@@ -54,19 +54,61 @@ Install Flask as an editable package using the current source::
5454

5555
Then you can run the testsuite with::
5656

57-
py.test
57+
pytest
5858

59-
With only py.test installed, a large part of the testsuite will get skipped
59+
With only pytest installed, a large part of the testsuite will get skipped
6060
though. Whether this is relevant depends on which part of Flask you're working
6161
on. Travis is set up to run the full testsuite when you submit your pull
6262
request anyways.
6363

6464
If you really want to test everything, you will have to install ``tox`` instead
65-
of ``pytest``. Currently we're depending on a development version of Tox
66-
because the released version is missing features we absolutely need. You can
67-
install it with::
65+
of ``pytest``. You can install it with::
6866

69-
pip install hg+https://bitbucket.org/hpk42/tox
67+
pip install tox
7068

7169
The ``tox`` command will then run all tests against multiple combinations
7270
Python versions and dependency versions.
71+
72+
Running test coverage
73+
---------------------
74+
Generating a report of lines that do not have unit test coverage can indicate where
75+
to start contributing. ``pytest`` integrates with ``coverage.py``, using the ``pytest-cov``
76+
plugin. This assumes you have already run the testsuite (see previous section)::
77+
78+
pip install pytest-cov
79+
80+
After this has been installed, you can output a report to the command line using this command::
81+
82+
pytest --cov=flask tests/
83+
84+
Generate a HTML report can be done using this command::
85+
86+
pytest --cov-report html --cov=flask tests/
87+
88+
Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io
89+
90+
Caution
91+
=======
92+
pushing
93+
-------
94+
This repository contains several zero-padded file modes that may cause issues when pushing this repository to git hosts other than github. Fixing this is destructive to the commit history, so we suggest ignoring these warnings. If it fails to push and you're using a self-hosted git service like Gitlab, you can turn off repository checks in the admin panel.
95+
96+
97+
cloning
98+
-------
99+
The zero-padded file modes files above can cause issues while cloning, too. If you have
100+
101+
::
102+
103+
[fetch]
104+
fsckobjects = true
105+
106+
or
107+
108+
::
109+
110+
[receive]
111+
fsckObjects = true
112+
113+
114+
set in your git configuration file, cloning this repository will fail. The only solution is to set both of the above settings to false while cloning, and then setting them back to true after the cloning is finished.

MANIFEST.in

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
include Makefile CHANGES LICENSE AUTHORS
2-
recursive-include artwork *
3-
recursive-include tests *
4-
recursive-include examples *
5-
recursive-include docs *
6-
recursive-exclude docs *.pyc
7-
recursive-exclude docs *.pyo
8-
recursive-exclude tests *.pyc
9-
recursive-exclude tests *.pyo
10-
recursive-exclude examples *.pyc
11-
recursive-exclude examples *.pyo
2+
3+
graft artwork
4+
graft tests
5+
graft examples
6+
graft docs
7+
8+
global-exclude *.py[co]
9+
1210
prune docs/_build
1311
prune docs/_themes

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
all: clean-pyc test
44

55
test:
6-
py.test tests examples
7-
8-
tox-test:
9-
tox
6+
pip install -r test-requirements.txt
7+
tox -e py-release
108

119
audit:
1210
python setup.py audit

README

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333

3434
Good that you're asking. The tests are in the
3535
tests/ folder. To run the tests use the
36-
`py.test` testing tool:
36+
`pytest` testing tool:
3737

38-
$ py.test
38+
$ pytest
39+
40+
Details on contributing can be found in CONTRIBUTING.rst
3941

4042
~ Where can I get help?
4143

docs/_templates/sidebarintro.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h3>Other Formats</h3>
1616
<h3>Useful Links</h3>
1717
<ul>
1818
<li><a href="http://flask.pocoo.org/">The Flask Website</a></li>
19-
<li><a href="http://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li>
20-
<li><a href="http://github.com/mitsuhiko/flask">Flask @ GitHub</a></li>
21-
<li><a href="http://github.com/mitsuhiko/flask/issues">Issue Tracker</a></li>
19+
<li><a href="https://pypi.python.org/pypi/Flask">Flask @ PyPI</a></li>
20+
<li><a href="https://github.com/pallets/flask">Flask @ GitHub</a></li>
21+
<li><a href="https://github.com/pallets/flask/issues">Issue Tracker</a></li>
2222
</ul>

0 commit comments

Comments
 (0)