Commit graph

3613 commits

Author SHA1 Message Date
Daniel Pope
ad9807891d Fix style issues on master using Black 2019-05-31 11:57:28 +01:00
David Lord
e285f3e56f Merge pull request #3157 from fantix/fix-test-client-teardown
Fix teardown bug in FlaskClient
2019-05-25 14:09:17 -07:00
Fantix King
9eadc5434b fix teardown bug in FlaskClient
* Fixes pytest-dev/pytest-flask#42
2019-05-25 14:03:28 -07:00
David Lord
01f993a7e5 Merge pull request #3124 from elbeardmorez/fix_static_url_path
fix 'static_url_path' defaulting for empty paths
2019-05-25 11:23:00 -07:00
David Lord
cfedcd308e strip static url trailing slash at assignment 2019-05-25 11:18:40 -07:00
Pete Beardmore
37b5569e92 fix 'static_url_path' defaulting for empty paths
-prefix a path delimiter iff there's a path to delimit
-ensures a valid default static route rule is created on application
intialisation for the case 'static_folder=""' and implicit
'static_url_path'
2019-05-25 07:03:36 -07:00
David Lord
88b988d1fa Merge pull request #2784 from doobeh/master
Add Blueprint level cli registration-- #1357
2019-05-24 14:47:48 -07:00
Anthony Plunkett
cc2580af09 Add Blueprint level cli command registration
Implements #1357.
Adds ability to register click cli commands onto blueprint.
2019-05-24 14:43:29 -07:00
David Lord
a9b94ca4f6 Merge pull request #3111 from pgjones/master
Allow dictionaries return values as JSON
2019-05-24 10:39:11 -07:00
David Lord
6d8c7c987d add quickstart about JSON responses 2019-05-24 10:28:12 -07:00
pgjones
9e0bd76d2a Allow dictionary return values as JSON
This supports an increasingly common usecase whereby JSON is the
primary response (rather than a templated string). Given Flask has a
short syntax for HTML reponses, it seems fitting that it should also
do so for JSON responses. In practice it allows,

     @app.route("/")
     def index():
         return {
             "api_stuff": "values",
         }
2019-05-24 09:48:55 -07:00
David Lord
d3085076af Merge pull request #2898 from rochacbruno/2897-Add-Extra-Files-to-CLI
Fix #2897 - Add `extra_files` option to `flask run` CLI
2019-05-24 07:32:45 -07:00
David Lord
9452450b6c add SeparatedPathType to accept multiple paths
Multiple paths for the reloader's `--extra-files` are accepted as one
option, separated by ':'.
2019-05-24 07:19:56 -07:00
Bruno Rocha
683584e5c5 Fix #2897 - Add extra_files option to flask run CLI 2019-05-23 10:47:41 -07:00
David Lord
8a3d1ed0ed Merge pull request #3208 from singingwolfboy/fakesignal-connect-via
FakeSignal should stub connect_via method
2019-05-23 08:22:07 -07:00
Joshua Bronson
000846559c Merge pull request #3213 from jab/contributing
Add pre-commit to dev dependencies, document it and Black in CONTRIBUTING.
2019-05-23 10:55:06 -04:00
jab
3e557534ee Add pre-commit to dev dependencies, document it and pre-commit in CONTRIBUTING
Now that we have a Black pre-commit hook (#3138),
ensure pre-commit gets installed on ``pip install -e .[dev]``
and document use of Black (rather than "try to follow pep8")
in CONTRIBUTING.
2019-05-23 10:51:38 -04:00
David Baumgold
b1a5093445 FakeSignal should stub connect_via method 2019-05-23 07:44:57 -07:00
David Lord
31c4757f0c Merge pull request #2939 from sharmaadarsh563/2937-correct-load_dotenv-return-value
Fix #2937: Ensure the consistency in load_dotenv's return type
2019-05-19 12:03:45 -07:00
Adarsh Sharma
c884f6ec19 Fix #2937: Ensure the consistency in load_dotenv's return type 2019-05-19 11:58:39 -07:00
David Lord
6888c7b63e Merge pull request #2928 from vorelq/2926-default-port-overrides-zero
Fix #2926 `Default port overrides requesting a system assigned port`
2019-05-19 11:40:54 -07:00
vorelq
c33ec49db6 Fix 0 port value being overriden by default
By explicitly comparing port value with None,
instead of using its bool() value.
2019-05-19 11:36:47 -07:00
David Lord
20e3f5f074 Merge pull request #3069 from shidenggui/feature_allow_customizing_url_map
Allow customizing url map class
2019-05-18 21:57:09 -07:00
shidenggui
e9efad7cf4 allow customizing url map class 2019-05-18 21:50:56 -07:00
David Lord
1593079758 Merge pull request #3195 from eruvanos/json_support_dataclass
Support dataclass in JSONEncoder (if available)
2019-05-18 21:44:21 -07:00
Eruvanos
36362454c3 support dataclass in JSONEncoder 2019-05-18 21:37:54 -07:00
David Lord
6c83bde636 Merge pull request #3182 from qil026/issue-3134-url-join
Remove ending slash from static_url_path
2019-05-18 21:27:31 -07:00
Frankie Liu
c7432f50cb Remove ending slash from static_url_path 2019-05-18 21:23:14 -07:00
David Lord
1dd28e18b2 Merge pull request #3185 from EtiennePelletier/Flask-3022
Simplify flask.cli.main
2019-05-18 21:19:57 -07:00
EtiennePelletier
5fe3d43ab6 Simplify flask.cli.main
Werkzeug>=0.15's reloader now properly detects `python -m module`.
Fixes #3022
2019-05-18 21:15:09 -07:00
David Lord
317e4663d7 Merge pull request #3181 from EtiennePelletier/Flask-3125
Use Werkzeug's JSONMixin class (moved from Flask) and update tests
2019-05-18 21:10:12 -07:00
EtiennePelletier
1a9616d581 Use Werkzeug's JSONMixin class and update tests
Flask's JSONMixin class was moved to Werkzeug>=0.15

Co-authored-by: Jeffrey Eliasen <jeff@jke.net>
2019-05-18 20:57:26 -07:00
David Lord
3a670370c8 Merge pull request #3190 from EtiennePelletier/jinja2-977
Make jinja_options a dict rather than ImmutaleDict
2019-05-18 08:44:03 -07:00
David Lord
797e24ebb2 use dict literal syntax for jinja_options
clarify docs about when jinja_options can be modified
2019-05-18 08:35:47 -07:00
EtiennePelletier
f2270e7a28 Make jinja_options a dict rather than ImmutaleDict
This allows changing jinja environment options from the flask app:
>>> app.jinja_options['undefined'] = jinja2.ChainableUndefined
2019-05-18 05:31:55 -07:00
David Lord
1a4dbe5c48 Merge pull request #3179 from Lee-W/MethodView-inheritance
Fix MethodView inheritance Error (#3138)
2019-05-17 14:18:40 -07:00
LeeW
43fe5f7d0b Inherit "methods" in MethodView
* Current behavior: If a base class inherits MethodView and child class
  inherits without overwriting "methods". The "methods" defined in base
  class would be ignored
* Fix: Inherit all the "methods" defined in base classes if "methods"
  variable is not overwritten
2019-05-17 13:57:06 -07:00
David Lord
c82324cb56 Merge pull request #3174 from icreatedanaccount/master
Allow mode='rt' on open_resource() helper
2019-05-17 13:32:40 -07:00
David Lord
479041907f add sphinx-issues 2019-05-17 13:26:54 -07:00
David Lord
371d1ab40d clean up open_resource and tests 2019-05-17 13:23:27 -07:00
icreatedanaccount
07a177043f Allow mode='rt' on open_resource() helper 2019-05-17 13:22:13 -07:00
David Lord
d37b992a54 Merge branch '1.0.x' 2019-05-17 11:13:08 -07:00
David Lord
92785ead80 release version 1.0.3 2019-05-17 10:57:51 -07:00
David Lord
5425b0c2eb Merge pull request #3206 from pallets/test-client-json
don't push app context for test client json
2019-05-17 09:04:37 -07:00
David Lord
8a431d4342 don't push app context for test client json 2019-05-17 09:00:08 -07:00
David Lord
f2df578d41 Merge pull request #3169 from DamianSkrzypczak/3168-improve-warning-about-dev-server-use-in-production
Fix dev-server warning message readability (#3168)
2019-05-16 19:23:19 -07:00
DamianSkrzypczak
975ede3628 Fix dev-server warning message readability (#3168) 2019-05-16 19:03:08 -07:00
David Lord
40d67dfc17 Merge pull request #3154 from brunoais/more-explicit-session-transaction
More explicit explanation: session testing
2019-05-16 18:17:45 -07:00
brunoais
b7bac12723 More explicit explanation: session testing
Use a more explicit explanation on how to write code to test own code
when sessions are needed.
The previous code was not fully explicit that the client is supposed
to be called after the session transaction and not during.
2019-05-16 18:07:18 -07:00
David Lord
81b0d5dfe8 Merge pull request #3166 from mekarpeles/refactor/unused-url_join
removed unused reference to url_join
2019-05-16 17:56:30 -07:00