mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 18:28:24 -04:00
Upgrade requirements.
With the upgrade of pep8 to 1.7.0 module imports are required to be at the top of the file, meaning I had to add a noqa line to some of the init files. Are those init files wrong or is pep8 too strict.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import dateutil
|
|
||||||
import urllib
|
import urllib
|
||||||
|
import dateutil
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
Flask,
|
Flask,
|
||||||
session,
|
session,
|
||||||
@@ -13,34 +13,31 @@ from flask import (
|
|||||||
current_app,
|
current_app,
|
||||||
request)
|
request)
|
||||||
from flask._compat import string_types
|
from flask._compat import string_types
|
||||||
|
from flask.globals import _lookup_req_object
|
||||||
from flask_login import LoginManager
|
from flask_login import LoginManager
|
||||||
from flask_wtf import CsrfProtect
|
from flask_wtf import CsrfProtect
|
||||||
|
from functools import partial
|
||||||
from notifications_python_client.errors import HTTPError
|
from notifications_python_client.errors import HTTPError
|
||||||
|
from notifications_utils import logging
|
||||||
|
from notifications_utils.recipients import validate_phone_number, InvalidPhoneError
|
||||||
from pygments import highlight
|
from pygments import highlight
|
||||||
from pygments.formatters.html import HtmlFormatter
|
from pygments.formatters.html import HtmlFormatter
|
||||||
from pygments.lexers.javascript import JavascriptLexer
|
from pygments.lexers.javascript import JavascriptLexer
|
||||||
from werkzeug.exceptions import abort
|
from werkzeug.exceptions import abort
|
||||||
|
from werkzeug.local import LocalProxy
|
||||||
|
|
||||||
|
import app.proxy_fix
|
||||||
|
from app.asset_fingerprinter import AssetFingerprinter
|
||||||
|
from app.its_dangerous_session import ItsdangerousSessionInterface
|
||||||
from app.notify_client.api_client import ServiceAPIClient
|
from app.notify_client.api_client import ServiceAPIClient
|
||||||
from app.notify_client.api_key_api_client import ApiKeyApiClient
|
from app.notify_client.api_key_api_client import ApiKeyApiClient
|
||||||
from app.notify_client.user_api_client import UserApiClient
|
from app.notify_client.invite_api_client import InviteApiClient
|
||||||
from app.notify_client.job_api_client import JobApiClient
|
from app.notify_client.job_api_client import JobApiClient
|
||||||
from app.notify_client.notification_api_client import NotificationApiClient
|
from app.notify_client.notification_api_client import NotificationApiClient
|
||||||
from app.notify_client.status_api_client import StatusApiClient
|
|
||||||
from app.notify_client.invite_api_client import InviteApiClient
|
|
||||||
from app.notify_client.statistics_api_client import StatisticsApiClient
|
from app.notify_client.statistics_api_client import StatisticsApiClient
|
||||||
|
from app.notify_client.status_api_client import StatusApiClient
|
||||||
from app.notify_client.template_statistics_api_client import TemplateStatisticsApiClient
|
from app.notify_client.template_statistics_api_client import TemplateStatisticsApiClient
|
||||||
|
from app.notify_client.user_api_client import UserApiClient
|
||||||
from app.its_dangerous_session import ItsdangerousSessionInterface
|
|
||||||
from app.asset_fingerprinter import AssetFingerprinter
|
|
||||||
from notifications_utils.recipients import validate_phone_number, InvalidPhoneError
|
|
||||||
import app.proxy_fix
|
|
||||||
from config import configs
|
|
||||||
from notifications_utils import logging
|
|
||||||
from werkzeug.local import LocalStack, LocalProxy
|
|
||||||
from flask.globals import _lookup_req_object
|
|
||||||
from functools import partial
|
|
||||||
|
|
||||||
|
|
||||||
login_manager = LoginManager()
|
login_manager = LoginManager()
|
||||||
csrf = CsrfProtect()
|
csrf = CsrfProtect()
|
||||||
@@ -108,6 +105,7 @@ def create_app():
|
|||||||
|
|
||||||
def _attach_current_service():
|
def _attach_current_service():
|
||||||
return {'current_service': current_service}
|
return {'current_service': current_service}
|
||||||
|
|
||||||
application.context_processor(_attach_current_service)
|
application.context_processor(_attach_current_service)
|
||||||
register_errorhandlers(application)
|
register_errorhandlers(application)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
|
||||||
main = Blueprint('main', __name__)
|
main = Blueprint('main', __name__) # noqa
|
||||||
|
|
||||||
from app.main.views import (
|
from app.main.views import (
|
||||||
index,
|
index,
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ from flask import Blueprint
|
|||||||
|
|
||||||
status = Blueprint('status', __name__)
|
status = Blueprint('status', __name__)
|
||||||
|
|
||||||
from app.status.views import healthcheck
|
from app.status.views import healthcheck # noqa
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Flask-Script==2.0.5
|
|||||||
Flask-WTF==0.11
|
Flask-WTF==0.11
|
||||||
Flask-Login==0.2.11
|
Flask-Login==0.2.11
|
||||||
credstash==1.8.0
|
credstash==1.8.0
|
||||||
boto3==1.2.3
|
boto3==1.3.0
|
||||||
Pygments==2.0.2
|
Pygments==2.0.2
|
||||||
py-gfm==0.1.2
|
py-gfm==0.1.2
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
-r requirements.txt
|
-r requirements.txt
|
||||||
pep8==1.5.7
|
pep8==1.7.0
|
||||||
pytest==2.8.1
|
pytest==2.9.1
|
||||||
pytest-mock==0.8.1
|
pytest-mock==0.11.0
|
||||||
pytest-cov==2.2.1
|
pytest-cov==2.2.1
|
||||||
coveralls==1.1
|
coveralls==1.1
|
||||||
moto==0.4.19
|
moto==0.4.23
|
||||||
httpretty==0.8.10
|
httpretty==0.8.14
|
||||||
beautifulsoup4==4.4.1
|
beautifulsoup4==4.4.1
|
||||||
|
|||||||
11
wsgi.py
11
wsgi.py
@@ -1,6 +1,10 @@
|
|||||||
from credstash import getAllSecrets
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from credstash import getAllSecrets
|
||||||
|
|
||||||
|
from app import create_app
|
||||||
|
from config import configs
|
||||||
|
|
||||||
default_env_file = '/home/ubuntu/environment'
|
default_env_file = '/home/ubuntu/environment'
|
||||||
environment = 'live'
|
environment = 'live'
|
||||||
|
|
||||||
@@ -8,16 +12,11 @@ if os.path.isfile(default_env_file):
|
|||||||
with open(default_env_file, 'r') as environment_file:
|
with open(default_env_file, 'r') as environment_file:
|
||||||
environment = environment_file.readline().strip()
|
environment = environment_file.readline().strip()
|
||||||
|
|
||||||
|
|
||||||
# on aws get secrets and export to env
|
# on aws get secrets and export to env
|
||||||
os.environ.update(getAllSecrets(region="eu-west-1"))
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
from config import configs
|
|
||||||
|
|
||||||
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
|
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
|
||||||
|
|
||||||
from app import create_app
|
|
||||||
|
|
||||||
application = create_app()
|
application = create_app()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user