mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05: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 re
|
||||
|
||||
import dateutil
|
||||
import urllib
|
||||
import dateutil
|
||||
|
||||
from flask import (
|
||||
Flask,
|
||||
session,
|
||||
@@ -13,34 +13,31 @@ from flask import (
|
||||
current_app,
|
||||
request)
|
||||
from flask._compat import string_types
|
||||
from flask.globals import _lookup_req_object
|
||||
from flask_login import LoginManager
|
||||
from flask_wtf import CsrfProtect
|
||||
from functools import partial
|
||||
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.formatters.html import HtmlFormatter
|
||||
from pygments.lexers.javascript import JavascriptLexer
|
||||
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_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.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.status_api_client import StatusApiClient
|
||||
from app.notify_client.template_statistics_api_client import TemplateStatisticsApiClient
|
||||
|
||||
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
|
||||
|
||||
from app.notify_client.user_api_client import UserApiClient
|
||||
|
||||
login_manager = LoginManager()
|
||||
csrf = CsrfProtect()
|
||||
@@ -108,6 +105,7 @@ def create_app():
|
||||
|
||||
def _attach_current_service():
|
||||
return {'current_service': current_service}
|
||||
|
||||
application.context_processor(_attach_current_service)
|
||||
register_errorhandlers(application)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from flask import Blueprint
|
||||
|
||||
main = Blueprint('main', __name__)
|
||||
main = Blueprint('main', __name__) # noqa
|
||||
|
||||
from app.main.views import (
|
||||
index,
|
||||
|
||||
@@ -2,4 +2,4 @@ from flask import Blueprint
|
||||
|
||||
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-Login==0.2.11
|
||||
credstash==1.8.0
|
||||
boto3==1.2.3
|
||||
boto3==1.3.0
|
||||
Pygments==2.0.2
|
||||
py-gfm==0.1.2
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
-r requirements.txt
|
||||
pep8==1.5.7
|
||||
pytest==2.8.1
|
||||
pytest-mock==0.8.1
|
||||
pep8==1.7.0
|
||||
pytest==2.9.1
|
||||
pytest-mock==0.11.0
|
||||
pytest-cov==2.2.1
|
||||
coveralls==1.1
|
||||
moto==0.4.19
|
||||
httpretty==0.8.10
|
||||
moto==0.4.23
|
||||
httpretty==0.8.14
|
||||
beautifulsoup4==4.4.1
|
||||
|
||||
11
wsgi.py
11
wsgi.py
@@ -1,6 +1,10 @@
|
||||
from credstash import getAllSecrets
|
||||
import os
|
||||
|
||||
from credstash import getAllSecrets
|
||||
|
||||
from app import create_app
|
||||
from config import configs
|
||||
|
||||
default_env_file = '/home/ubuntu/environment'
|
||||
environment = 'live'
|
||||
|
||||
@@ -8,16 +12,11 @@ if os.path.isfile(default_env_file):
|
||||
with open(default_env_file, 'r') as environment_file:
|
||||
environment = environment_file.readline().strip()
|
||||
|
||||
|
||||
# on aws get secrets and export to env
|
||||
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||
|
||||
from config import configs
|
||||
|
||||
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
|
||||
|
||||
from app import create_app
|
||||
|
||||
application = create_app()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user