From c6a619af833416160475c25aa3d11ef14ed74618 Mon Sep 17 00:00:00 2001 From: David Lord Date: Thu, 2 Apr 2020 12:09:04 -0700 Subject: [PATCH 1/4] update CLI docs IDE integration --- docs/cli.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 96c5396f..c50872a7 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -491,10 +491,10 @@ script is available. Note that you don't need to set ``FLASK_APP``. :: PyCharm Integration ------------------- -Prior to PyCharm 2018.1, the Flask CLI features weren't yet fully -integrated into PyCharm. We have to do a few tweaks to get them working -smoothly. These instructions should be similar for any other IDE you -might want to use. +PyCharm Professional provides a special Flask run configuration. For +the Community Edition, we need to configure it to call the ``flask run`` +CLI command with the correct environment variables. These instructions +should be similar for any other IDE you might want to use. In PyCharm, with your project open, click on *Run* from the menu bar and go to *Edit Configurations*. You'll be greeted by a screen similar to @@ -503,7 +503,7 @@ this: .. image:: _static/pycharm-runconfig.png :align: center :class: screenshot - :alt: screenshot of pycharm's run configuration settings + :alt: Screenshot of PyCharms's run configuration settings. There's quite a few options to change, but once we've done it for one command, we can easily copy the entire configuration and make a single @@ -511,9 +511,9 @@ tweak to give us access to other commands, including any custom ones you may implement yourself. Click the + (*Add New Configuration*) button and select *Python*. Give -the configuration a good descriptive name such as "Run Flask Server". -For the ``flask run`` command, check "Single instance only" since you -can't run the server more than once at the same time. +the configuration a name such as "flask run". For the ``flask run`` +command, check "Single instance only" since you can't run the server +more than once at the same time. Select *Module name* from the dropdown (**A**) then input ``flask``. @@ -524,7 +524,8 @@ the development server. You can skip this next step if you're using :ref:`dotenv`. We need to add an environment variable (**C**) to identify our application. Click on the browse button and add an entry with ``FLASK_APP`` on the left and -the Python import or file on the right (``hello`` for example). +the Python import or file on the right (``hello`` for example). Add an +entry with ``FLASK_ENV`` and set it to ``development``. Next we need to set the working directory (**D**) to be the folder where our application resides. From 4548e00dba81a5e60024d76b35bcfe2a7be8e675 Mon Sep 17 00:00:00 2001 From: Jeenu Viswambharan Date: Fri, 20 Mar 2020 09:41:00 +0000 Subject: [PATCH 2/4] clarify static_folder is relative to root_path --- src/flask/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flask/app.py b/src/flask/app.py index e596fe57..2f9110ec 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -170,9 +170,9 @@ class Flask(_PackageBoundObject): :param static_url_path: can be used to specify a different path for the static files on the web. Defaults to the name of the `static_folder` folder. - :param static_folder: the folder with static files that should be served - at `static_url_path`. Defaults to the ``'static'`` - folder in the root path of the application. + :param static_folder: The folder with static files that is served at + ``static_url_path``. Relative to the application ``root_path`` + or an absolute path. Defaults to ``'static'``. :param static_host: the host to use when adding the static route. Defaults to None. Required when using ``host_matching=True`` with a ``static_folder`` configured. From 4024a4a89c18a1048b7496cf223c0b8c1e63c485 Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 3 Apr 2020 10:02:40 -0700 Subject: [PATCH 3/4] update deprecation versions --- src/flask/app.py | 25 +++++++++++++------------ src/flask/testing.py | 10 +++++----- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/flask/app.py b/src/flask/app.py index 2f9110ec..e385899e 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -1074,16 +1074,16 @@ class Flask(_PackageBoundObject): we recommend replacing the :class:`session_interface`. .. deprecated: 1.0 - Will be removed in 1.1. Use ``session_interface.open_session`` - instead. + Will be removed in 2.0. Use + ``session_interface.open_session`` instead. :param request: an instance of :attr:`request_class`. """ warnings.warn( DeprecationWarning( - '"open_session" is deprecated and will be removed in 1.1. Use' - ' "session_interface.open_session" instead.' + '"open_session" is deprecated and will be removed in' + ' 2.0. Use "session_interface.open_session" instead.' ) ) return self.session_interface.open_session(self, request) @@ -1094,8 +1094,8 @@ class Flask(_PackageBoundObject): method we recommend replacing the :class:`session_interface`. .. deprecated: 1.0 - Will be removed in 1.1. Use ``session_interface.save_session`` - instead. + Will be removed in 2.0. Use + ``session_interface.save_session`` instead. :param session: the session to be saved (a :class:`~werkzeug.contrib.securecookie.SecureCookie` @@ -1105,8 +1105,8 @@ class Flask(_PackageBoundObject): warnings.warn( DeprecationWarning( - '"save_session" is deprecated and will be removed in 1.1. Use' - ' "session_interface.save_session" instead.' + '"save_session" is deprecated and will be removed in' + ' 2.0. Use "session_interface.save_session" instead.' ) ) return self.session_interface.save_session(self, session, response) @@ -1116,16 +1116,17 @@ class Flask(_PackageBoundObject): this method we recommend replacing the :class:`session_interface`. .. deprecated: 1.0 - Will be removed in 1.1. Use ``session_interface.make_null_session`` - instead. + Will be removed in 2.0. Use + ``session_interface.make_null_session`` instead. .. versionadded:: 0.7 """ warnings.warn( DeprecationWarning( - '"make_null_session" is deprecated and will be removed in 1.1. Use' - ' "session_interface.make_null_session" instead.' + '"make_null_session" is deprecated and will be removed' + ' in 2.0. Use "session_interface.make_null_session"' + " instead." ) ) return self.session_interface.make_null_session(self) diff --git a/src/flask/testing.py b/src/flask/testing.py index b27dfcca..62766a50 100644 --- a/src/flask/testing.py +++ b/src/flask/testing.py @@ -99,14 +99,14 @@ def make_test_environ_builder(*args, **kwargs): """Create a :class:`flask.testing.EnvironBuilder`. .. deprecated: 1.1 - Will be removed in 1.2. Construct ``flask.testing.EnvironBuilder`` - directly instead. + Will be removed in 2.0. Construct + ``flask.testing.EnvironBuilder`` directly instead. """ warnings.warn( DeprecationWarning( - '"make_test_environ_builder()" is deprecated and will be removed ' - 'in 1.2. Construct "flask.testing.EnvironBuilder" directly ' - "instead." + '"make_test_environ_builder()" is deprecated and will be' + ' removed in 2.0. Construct "flask.testing.EnvironBuilder"' + " directly instead." ) ) return EnvironBuilder(*args, **kwargs) From 93dd1709d05a1cf0e886df6223377bdab3b077fb Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 3 Apr 2020 10:08:11 -0700 Subject: [PATCH 4/4] release version 1.1.2 --- CHANGES.rst | 2 +- MANIFEST.in | 1 + src/flask/__init__.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index ae07651a..a85313eb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,7 +3,7 @@ Version 1.1.2 ------------- -Unreleased +Released 2020-04-03 - Work around an issue when running the ``flask`` command with an external debugger on Windows. :issue:`3297` diff --git a/MANIFEST.in b/MANIFEST.in index 555022cb..b2c37b97 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,3 +6,4 @@ graft docs prune docs/_build graft examples graft tests +global-exclude *.pyc diff --git a/src/flask/__init__.py b/src/flask/__init__.py index d0e105d5..1a487e18 100644 --- a/src/flask/__init__.py +++ b/src/flask/__init__.py @@ -57,4 +57,4 @@ from .signals import template_rendered from .templating import render_template from .templating import render_template_string -__version__ = "1.1.2.dev" +__version__ = "1.1.2"