Skip to content

Commit

Permalink
Fix up flake8 runtime configuration, do a bit of flake8 work as it
Browse files Browse the repository at this point in the history
relates to pyflakes)
  • Loading branch information
matburt committed Feb 5, 2015
1 parent 6a77c5d commit 888ae53
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 42 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ pep8:
pyflakes:
pyflakes awx/

check:
flake8

# Run all API unit tests.
test:
$(PYTHON) manage.py test -v2 awx.main.tests
Expand Down
4 changes: 2 additions & 2 deletions awx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Check for the presence/absence of "devonly" module to determine if running
# from a source code checkout or release packaage.
try:
import awx.devonly
import awx.devonly # noqa
MODE = 'development'
except ImportError: # pragma: no cover
MODE = 'production'
Expand Down Expand Up @@ -57,7 +57,7 @@ def prepare_env():
import six
sys.modules['django.utils.six'] = sys.modules['six']
django.utils.six = sys.modules['django.utils.six']
from django.utils import six
from django.utils import six # noqa
# Use the AWX_TEST_DATABASE_* environment variables to specify the test
# database settings to use when management command is run as an external
# program via unit tests.
Expand Down
7 changes: 2 additions & 5 deletions awx/api/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
# Python
import inspect
import logging
import json
import time

# Django
from django.http import Http404
from django.conf import settings
from django.contrib.auth.models import User
from django.db import connection
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.timezone import now

# Django REST Framework
from rest_framework.authentication import get_authorization_header
Expand All @@ -27,8 +24,8 @@
from rest_framework import views

# AWX
from awx.main.models import *
from awx.main.utils import *
from awx.main.models import * # noqa
from awx.main.utils import * # noqa

__all__ = ['APIView', 'GenericAPIView', 'ListAPIView', 'SimpleListAPIView',
'ListCreateAPIView', 'SubListAPIView', 'SubListCreateAPIView',
Expand Down
15 changes: 6 additions & 9 deletions awx/urls.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# Copyright (c) 2014 AnsibleWorks, Inc.
# All Rights Reserved.

from django.conf import settings
from django.conf.urls import *
from django.conf.urls import url, patterns, include

handler403 = 'awx.main.views.handle_403'
handler404 = 'awx.main.views.handle_404'
handler500 = 'awx.main.views.handle_500'

urlpatterns = patterns('',
url(r'', include('awx.ui.urls', namespace='ui', app_name='ui')),
url(r'^api/', include('awx.api.urls', namespace='api', app_name='api')),
)
url(r'', include('awx.ui.urls', namespace='ui', app_name='ui')),
url(r'^api/', include('awx.api.urls', namespace='api', app_name='api')))

urlpatterns += patterns('awx.main.views',
url(r'^403.html$', 'handle_403'),
url(r'^404.html$', 'handle_404'),
url(r'^500.html$', 'handle_500'),
)
url(r'^403.html$', 'handle_403'),
url(r'^404.html$', 'handle_404'),
url(r'^500.html$', 'handle_500'))
2 changes: 0 additions & 2 deletions awx/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
from awx import prepare_env
prepare_env()

import os
import logging
from django.conf import settings
from awx import __version__ as tower_version
logger = logging.getLogger('awx.main.models.jobs')
try:
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
# W293 - Blank line contains whitespace
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E302,E303,E501,W291,W391,W293
exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data

[flake8]
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E302,E303,E501,W291,W391,W293
exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data
46 changes: 22 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
# Copyright (c) 2014 AnsibleWorks, Inc.
# All Rights Reserved.

import os, datetime, glob, sys, shutil
from distutils import log
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist as _sdist
import os
import datetime
import glob
import sys
import shutil
from setuptools import setup

from awx import __version__

Expand Down Expand Up @@ -113,26 +115,22 @@ def proc_data_files(data_files):
],
},
data_files = proc_data_files([
("%s" % homedir, ["config/wsgi.py",
"awx/static/favicon.ico",
]),
("%s" % webconfig, ["config/awx-httpd-80.conf",
"config/awx-httpd-443.conf",
"config/awx-munin.conf",
]),
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh",]),
("%s" % munin_plugin_path, ["tools/munin_monitors/tower_jobs",
"tools/munin_monitors/callbackr_alive",
"tools/munin_monitors/celery_alive",
"tools/munin_monitors/postgres_alive",
"tools/munin_monitors/redis_alive",
"tools/munin_monitors/socketio_alive",
"tools/munin_monitors/taskmanager_alive"]),
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
("%s" % sosconfig, ["tools/sosreport/tower.py"]),
]
),
("%s" % homedir, ["config/wsgi.py",
"awx/static/favicon.ico"]),
("%s" % webconfig, ["config/awx-httpd-80.conf",
"config/awx-httpd-443.conf",
"config/awx-munin.conf"]),
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh",]),
("%s" % munin_plugin_path, ["tools/munin_monitors/tower_jobs",
"tools/munin_monitors/callbackr_alive",
"tools/munin_monitors/celery_alive",
"tools/munin_monitors/postgres_alive",
"tools/munin_monitors/redis_alive",
"tools/munin_monitors/socketio_alive",
"tools/munin_monitors/taskmanager_alive"]),
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
("%s" % sosconfig, ["tools/sosreport/tower.py"])]),
options = {
'egg_info': {
'tag_build': build_timestamp,
Expand Down

0 comments on commit 888ae53

Please sign in to comment.