diff --git a/.travis.yml b/.travis.yml index fe40f45..34c0355 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,14 @@ env: - DJANGO=1.4.3 DB=sqlite before_install: - export PIP_USE_MIRRORS=true -before_script: - - export DJANGO_SETTINGS_MODULE=timezone_field.test_settings - - psql -c 'create database timezone_field_test;' -U postgres install: - pip install psycopg2 - pip install django==$DJANGO + - pip install pep8 - pip install -e . +before_script: + - export DJANGO_SETTINGS_MODULE=timezone_field.test_settings + - psql -c 'create database timezone_field_test;' -U postgres + - pep8 . script: - django-admin.py test timezone_field diff --git a/setup.py b/setup.py index cfb4065..1f7a361 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,15 @@ from os import path from setuptools import setup + # read() and find_version() taken from jezdez's python apps, ex: # https://github.com/jezdez/django_compressor/blob/develop/setup.py + def read(*parts): return open(path.join(path.dirname(__file__), *parts)).read() + def find_version(*file_paths): version_file = read(*file_paths) version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", @@ -16,6 +19,7 @@ def find_version(*file_paths): return version_match.group(1) raise RuntimeError("Unable to find version string.") + setup( name='django-timezone-field', version=find_version('timezone_field', '__init__.py'), diff --git a/timezone_field/fields.py b/timezone_field/fields.py index e5ef299..25465e4 100644 --- a/timezone_field/fields.py +++ b/timezone_field/fields.py @@ -84,7 +84,7 @@ def _get_python_and_db_repr(self, value): [], # Positional arguments (not used) { # Keyword argument 'max_length': [ - 'max_length', { 'default': TimeZoneField.MAX_LENGTH } + 'max_length', {'default': TimeZoneField.MAX_LENGTH}, ], }, )], diff --git a/timezone_field/test_settings.py b/timezone_field/test_settings.py index 620179e..e0b0c3f 100644 --- a/timezone_field/test_settings.py +++ b/timezone_field/test_settings.py @@ -82,7 +82,7 @@ STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', + #'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. @@ -92,7 +92,7 @@ TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', + #'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( @@ -111,7 +111,8 @@ WSGI_APPLICATION = 'test_project.wsgi.application' TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Put strings here, like "/home/html/django_templates" or + # "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) diff --git a/timezone_field/tests.py b/timezone_field/tests.py index 1ed3920..e4515f7 100644 --- a/timezone_field/tests.py +++ b/timezone_field/tests.py @@ -8,9 +8,9 @@ from . import TimeZoneField -PST = 'America/Los_Angeles' # instance of pytz.tzinfo.DstTzInfo -GMT = 'Etc/GMT' # instance of pytz.tzinfo.StaticTzInfo -UTC = 'UTC' # pytz.UTC singleton +PST = 'America/Los_Angeles' # instance of pytz.tzinfo.DstTzInfo +GMT = 'Etc/GMT' # instance of pytz.tzinfo.StaticTzInfo +UTC = 'UTC' # pytz.UTC singleton INVALID_TZ = 'ogga booga'