Add setup.cfg for QA tools, fix flake8 warnings

This commit is contained in:
Jan Dittberner 2016-01-31 23:29:56 +01:00
parent ed18c4a6f9
commit 32366e93dd
6 changed files with 62 additions and 43 deletions

1
.gitignore vendored
View file

@ -42,3 +42,4 @@ Desktop.ini
_build/
.vagrant/
.coverage
coverage-report/

View file

@ -30,7 +30,7 @@ def get_env_variable(var_name):
raise ImproperlyConfigured(error_msg)
########## PATH CONFIGURATION
# ######### PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
@ -43,27 +43,27 @@ SITE_NAME = basename(DJANGO_ROOT)
# Add our project to our pythonpath, this way we don't need to type our project
# name in our dotted import paths:
path.append(DJANGO_ROOT)
########## END PATH CONFIGURATION
# ######### END PATH CONFIGURATION
########## DEBUG CONFIGURATION
# ######### DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
########## MANAGER CONFIGURATION
# ######### MANAGER CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = (
(get_env_variable('GVALDAP_ADMIN_NAME'), get_env_variable('GVALDAP_ADMIN_EMAIL')),
(get_env_variable('GVALDAP_ADMIN_NAME'),
get_env_variable('GVALDAP_ADMIN_EMAIL')),
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
########## END MANAGER CONFIGURATION
# ######### END MANAGER CONFIGURATION
########## DATABASE CONFIGURATION
# ######### DATABASE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
'default': {
@ -82,10 +82,10 @@ DATABASES = {
}
}
DATABASE_ROUTERS = ['ldapdb.router.Router']
########## END DATABASE CONFIGURATION
# ######### END DATABASE CONFIGURATION
########## GENERAL CONFIGURATION
# ######### GENERAL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone
TIME_ZONE = 'Europe/Berlin'
@ -103,52 +103,54 @@ USE_L10N = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
USE_TZ = True
########## END GENERAL CONFIGURATION
# ######### END GENERAL CONFIGURATION
########## MEDIA CONFIGURATION
# ######### MEDIA CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
MEDIA_ROOT = normpath(join(SITE_ROOT, 'media'))
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
MEDIA_URL = '/media/'
########## END MEDIA CONFIGURATION
# ######### END MEDIA CONFIGURATION
########## STATIC FILE CONFIGURATION
# ######### STATIC FILE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = '/static/'
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
# See:
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders # noqa
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
########## END STATIC FILE CONFIGURATION
# ######### END STATIC FILE CONFIGURATION
########## SECRET CONFIGURATION
# ######### SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Note: This key should only be used for development and testing.
SECRET_KEY = get_env_variable('GVALDAP_SECRETKEY')
########## END SECRET CONFIGURATION
# ######### END SECRET CONFIGURATION
########## SITE CONFIGURATION
# ######### SITE CONFIGURATION
# Hosts/domain names that are valid for this site
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
########## END SITE CONFIGURATION
# ######### END SITE CONFIGURATION
########## FIXTURE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
# ######### FIXTURE CONFIGURATION
# See:
# https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS # noqa
FIXTURE_DIRS = (
normpath(join(SITE_ROOT, 'fixtures')),
)
########## END FIXTURE CONFIGURATION
# ######### END FIXTURE CONFIGURATION
########## TEMPLATE CONFIGURATION
# ######### TEMPLATE CONFIGURATION
# See: https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-TEMPLATES # noqa
TEMPLATES = [
{
@ -172,10 +174,10 @@ TEMPLATES = [
},
]
########## END TEMPLATE CONFIGURATION
# ######### END TEMPLATE CONFIGURATION
########## MIDDLEWARE CONFIGURATION
# ######### MIDDLEWARE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#middleware-classes
MIDDLEWARE_CLASSES = (
# Default Django middleware.
@ -187,21 +189,21 @@ MIDDLEWARE_CLASSES = (
'django.middleware.locale.LocaleMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
########## END MIDDLEWARE CONFIGURATION
# ######### END MIDDLEWARE CONFIGURATION
########## URL CONFIGURATION
# ######### URL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf
ROOT_URLCONF = '%s.urls' % SITE_NAME
########## END URL CONFIGURATION
# ######### END URL CONFIGURATION
########## TEST RUNNER CONFIGURATION
# ######### TEST RUNNER CONFIGURATION
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
########## END TEST RUNNER CONFIGURATION
# ######### END TEST RUNNER CONFIGURATION
########## APP CONFIGURATION
# ######### APP CONFIGURATION
DJANGO_APPS = (
# Default Django apps:
'django.contrib.auth',
@ -223,10 +225,10 @@ LOCAL_APPS = (
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + LOCAL_APPS
########## END APP CONFIGURATION
# ######### END APP CONFIGURATION
########## LOGGING CONFIGURATION
# ######### LOGGING CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
@ -265,13 +267,13 @@ LOGGING = {
},
}
}
########## END LOGGING CONFIGURATION
# ######### END LOGGING CONFIGURATION
########## WSGI CONFIGURATION
# ######### WSGI CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
########## END WSGI CONFIGURATION
# ######### END WSGI CONFIGURATION
# ######### LDAP SETTINGS
@ -280,7 +282,7 @@ USER_BASE_DN = get_env_variable('GVALDAP_BASEDN_USER')
# ######### END LDAP SETTINGS
########## CELERY CONFIGURATION
# ######### CELERY CONFIGURATION
BROKER_URL = get_env_variable('GVALDAP_BROKER_URL')
CELERY_RESULT_BACKEND = get_env_variable('GVALDAP_RESULTS_REDIS_URL')
CELERY_TASK_RESULT_EXPIRES = None
@ -292,4 +294,4 @@ CELERY_ENABLE_UTC = True
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
########## END CELERY CONFIGURATION
# ######### END CELERY CONFIGURATION

View file

@ -36,8 +36,8 @@ CACHES = {
# ######### END CACHE CONFIGURATION
########## TOOLBAR CONFIGURATION
# See: http://django-debug-toolbar.readthedocs.org/en/latest/installation.html#explicit-setup
# ######### TOOLBAR CONFIGURATION
# See: http://django-debug-toolbar.readthedocs.org/en/latest/installation.html#explicit-setup # noqa
INSTALLED_APPS += (
'debug_toolbar',
)

View file

@ -11,7 +11,7 @@ from .base import * # NOQA
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
########## IN-MEMORY TEST DATABASE
# ######### IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",

View file

@ -26,10 +26,10 @@ path.append(SITE_ROOT)
# os.environ["DJANGO_SETTINGS_MODULE"] = "jajaja.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gvaldap.settings.production")
from django.core.wsgi import get_wsgi_application
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application # noqa
application = get_wsgi_application()
# Apply WSGI middleware here.

16
gvaldap/setup.cfg Normal file
View file

@ -0,0 +1,16 @@
[pep8]
exclude = migrations
[flake8]
exclude = migrations
[coverage:run]
source = gvaldap,ldapentities,ldaptasks
branch = True
[coverage:report]
omit = */migrations/*,*/tests/*.py,*/tests.py,gvaldap/settings/local.py,gvaldap/settings/production.py
show_missing = True
[coverage:html]
directory = ../coverage-report