mistercrunch closed pull request #6239: Bump Flask, bleach and  sync pip-compile
URL: https://github.com/apache/incubator-superset/pull/6239
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.flaskenv b/.flaskenv
new file mode 100644
index 0000000000..8520f896ff
--- /dev/null
+++ b/.flaskenv
@@ -0,0 +1 @@
+FLASK_APP=superset:app
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6104c12ba1..40dfd29d2b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -221,8 +221,8 @@ superset init
 # Load some data to play with
 superset load_examples
 
-# Start the Flask web server (but see below for frontend asset compilation)
-superset runserver -d
+# Start the Flask dev web server (but see below for frontend asset compilation)
+flask run -p 8080 --with-threads --reload --debugger
 ```
 
 #### Logging to the browser console
diff --git a/contrib/docker/docker-entrypoint.sh 
b/contrib/docker/docker-entrypoint.sh
index c6629c7b70..368f6866c1 100644
--- a/contrib/docker/docker-entrypoint.sh
+++ b/contrib/docker/docker-entrypoint.sh
@@ -4,7 +4,7 @@ set -ex
 if [ "$#" -ne 0 ]; then
     exec "$@"
 elif [ "$SUPERSET_ENV" = "local" ]; then
-    superset runserver -d
+    flask run -p 8080 --with-threads --reload --debugger
 elif [ "$SUPERSET_ENV" = "production" ]; then
     superset runserver -a 0.0.0.0 -w $((2 * $(getconf _NPROCESSORS_ONLN) + 1))
 else
diff --git a/contrib/docker/docker-init.sh b/contrib/docker/docker-init.sh
index 940ad4fa34..890c4ebf17 100644
--- a/contrib/docker/docker-init.sh
+++ b/contrib/docker/docker-init.sh
@@ -20,5 +20,5 @@ cd superset/assets && npm run build && cd ../../
 # Start superset worker for SQL Lab
 superset worker &
 
-# To start a development web server, use the -d switch
-superset runserver -d
+# Start the dev web server
+flask run -p 8080 --with-threads --reload --debugger
diff --git a/requirements-dev.txt b/requirements-dev.txt
index ee3c3ffe08..0b991fc0b8 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,4 +1,5 @@
 console_log==0.2.10
+python-dotenv
 flake8-commas==2.0.0
 flake8-import-order==0.18
 flake8-quotes==1.0.0
diff --git a/requirements.txt b/requirements.txt
index c2587f7682..f3446ad55b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,7 +9,7 @@ amqp==2.3.2               # via kombu
 asn1crypto==0.24.0        # via cryptography
 babel==2.6.0              # via flask-babel, flower
 billiard==3.5.0.4         # via celery
-bleach==2.1.2
+bleach==3.0.2
 boto3==1.4.7
 botocore==1.7.48
 cchardet==1.0.0           # via tabulator
@@ -33,12 +33,11 @@ flask-migrate==2.1.1
 flask-openid==1.2.5       # via flask-appbuilder
 flask-sqlalchemy==2.3.2   # via flask-appbuilder, flask-migrate
 flask-wtf==0.14.2
-flask==0.12.2
+flask==1.0.2
 flower==0.9.2
-future==0.16.0
+future==0.16.0            # via pyhive
 geopy==1.11.0
 gunicorn==19.8.0
-html5lib==1.0.1           # via bleach
 humanize==0.5.1
 idna==2.6
 ijson==2.3                # via tabulator
@@ -74,7 +73,7 @@ rfc3986==1.1.0            # via tableschema
 s3transfer==0.1.13        # via boto3
 sasl==0.2.1               # via thrift-sasl
 simplejson==3.15.0
-six==1.11.0               # via bleach, cryptography, html5lib, isodate, 
jsonlines, linear-tsv, pathlib2, polyline, pydruid, python-dateutil, sasl, 
sqlalchemy-utils, tableschema, tabulator, thrift
+six==1.11.0               # via bleach, cryptography, isodate, jsonlines, 
linear-tsv, pathlib2, polyline, pydruid, python-dateutil, sasl, 
sqlalchemy-utils, tableschema, tabulator, thrift
 sqlalchemy-utils==0.32.21
 sqlalchemy==1.2.2
 sqlparse==0.2.4
@@ -87,7 +86,7 @@ unicodecsv==0.14.1
 unidecode==1.0.22
 urllib3==1.22             # via requests
 vine==1.1.4               # via amqp
-webencodings==0.5.1       # via html5lib
+webencodings==0.5.1       # via bleach
 werkzeug==0.14.1          # via flask
 wtforms==2.2.1            # via flask-wtf
 xlrd==1.1.0               # via tabulator
diff --git a/setup.py b/setup.py
index e7d12d8884..6985dbaada 100644
--- a/setup.py
+++ b/setup.py
@@ -53,7 +53,7 @@ def get_git_sha():
     zip_safe=False,
     scripts=['superset/bin/superset'],
     install_requires=[
-        'bleach',
+        'bleach>=3.0.2, <4.0.0',
         'boto3>=1.4.7, <2.0.0',
         'botocore>=1.7.0, <1.8.0',
         'celery>=4.2.0, <5.0.0',
diff --git a/superset/__init__.py b/superset/__init__.py
index b005452d05..0a267e8fb6 100644
--- a/superset/__init__.py
+++ b/superset/__init__.py
@@ -99,11 +99,11 @@ def get_manifest():
     logging.getLogger('flask_appbuilder').setLevel(logging.ERROR)
 
 if app.debug:
-    app.logger.setLevel(logging.DEBUG)
+    app.logger.setLevel(logging.DEBUG)  # pylint: disable=no-member
 else:
     # In production mode, add log handler to sys.stderr.
-    app.logger.addHandler(logging.StreamHandler())
-    app.logger.setLevel(logging.INFO)
+    app.logger.addHandler(logging.StreamHandler())  # pylint: disable=no-member
+    app.logger.setLevel(logging.INFO)  # pylint: disable=no-member
 logging.getLogger('pyhive.presto').setLevel(logging.INFO)
 
 db = SQLA(app)
diff --git a/superset/bin/superset b/superset/bin/superset
index 70968c6964..86134993d4 100755
--- a/superset/bin/superset
+++ b/superset/bin/superset
@@ -1,15 +1,15 @@
 #!/usr/bin/env python
-import warnings
 import click
 from flask.cli import FlaskGroup
-from flask.exthook import ExtDeprecationWarning
+
 from superset.cli import create_app
 
-warnings.simplefilter('ignore', ExtDeprecationWarning)
 
 @click.group(cls=FlaskGroup, create_app=create_app)
 def cli():
-    """This is a management script for the superset application."""
+    """This is a management script for the Superset application."""
+    pass
+
 
 if __name__ == '__main__':
     cli()
diff --git a/superset/cli.py b/superset/cli.py
index 51a1db48d0..2dbcb10845 100755
--- a/superset/cli.py
+++ b/superset/cli.py
@@ -38,12 +38,17 @@ def init():
 
 
 def debug_run(app, port, use_reloader):
-    return app.run(
-        host='0.0.0.0',
-        port=int(port),
-        threaded=True,
-        debug=True,
-        use_reloader=use_reloader)
+    click.secho(
+        '[DEPRECATED] As of Flask >=1.0.0, this command is no longer '
+        'supported, please use `flask run` instead, as documented in our '
+        'CONTRIBUTING.md',
+        fg='red',
+    )
+    click.secho('[example]', fg='yellow')
+    click.secho(
+        'flask run -p 8080 --with-threads --reload --debugger',
+        fg='green',
+    )
 
 
 def console_log_run(app, port, use_reloader):


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to