From 43e41c5a0389aff0102fcbdd3e30bd9ff620edde Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 12:22:59 -0400 Subject: [PATCH 1/7] Updated Travis config. --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6a32fc..ecafe36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,16 @@ language: python python: + - "2.6" - "2.7" + - "3.2" + - "3.3" - "3.4" - "3.5" env: - DJANGO=1.9 - DJANGO=1.10 install: - - pip install -q Django==$DJANGO --use-mirrors - - pip install -q -e . --use-mirrors + - pip install -q Django==$DJANGO + - pip install -q -e . script: - python setup.py test From 3d000f5d7d2f7203e6952ad7f0e142b218826151 Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 12:51:22 -0400 Subject: [PATCH 2/7] Removed migration dependencies. --- discord_bind/migrations/0001_initial.py | 7 ++--- discord_bind/views.py | 5 +++- manage.py | 36 +++++++++++++++++++++++++ test_settings.py | 5 ++-- 4 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 manage.py diff --git a/discord_bind/migrations/0001_initial.py b/discord_bind/migrations/0001_initial.py index 46bc334..4eb40e0 100644 --- a/discord_bind/migrations/0001_initial.py +++ b/discord_bind/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-08-12 04:43 +# Generated by Django 1.10 on 2016-08-13 12:50 from __future__ import unicode_literals from django.conf import settings @@ -11,10 +11,7 @@ class Migration(migrations.Migration): initial = True - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('auth', '0008_alter_user_username_max_length'), - ] + dependencies = [] operations = [ migrations.CreateModel( diff --git a/discord_bind/views.py b/discord_bind/views.py index 8d447fb..a31523c 100644 --- a/discord_bind/views.py +++ b/discord_bind/views.py @@ -30,7 +30,10 @@ from django.conf import settings from django.http import HttpResponseRedirect -from django.urls import reverse +try: + from django.urls import reverse +except ImportError: + from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.utils.timezone import make_aware from django.db.models import Q diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..99b4574 --- /dev/null +++ b/manage.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +""" + +The MIT License (MIT) + +Copyright (c) 2016 Mark Rogaski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +""" + +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/test_settings.py b/test_settings.py index 881be39..96835b9 100644 --- a/test_settings.py +++ b/test_settings.py @@ -26,17 +26,18 @@ DATABASES = { 'default': { + 'NAME': 'test.db', 'ENGINE': 'django.db.backends.sqlite3', } } INSTALLED_APPS = ( - 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', - 'django.contrib.staticfiles', 'discord_bind', ) +SECRET_KEY = 'vn5v8g+q3q*ll)a3kh10wlj#(tc=738cklg9(z3***kw%qhnv-' +ROOT_URLCONF='discord_bind.urls' From d47cf0c00af82893546c554110078d37785539ac Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 12:56:53 -0400 Subject: [PATCH 3/7] Fixed mock requirements. --- .travis.yml | 1 - setup.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ecafe36..8e28829 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: python python: - "2.6" - "2.7" - - "3.2" - "3.3" - "3.4" - "3.5" diff --git a/setup.py b/setup.py index 60fecab..16e1d4a 100644 --- a/setup.py +++ b/setup.py @@ -68,6 +68,7 @@ ], tests_require=[ "django-setuptest >= 0.2.1", + "mock" ], test_suite='setuptest.setuptest.SetupTestSuite', ) \ No newline at end of file From 95fee35a53bf539578a0249c9a10af00cf01ed65 Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 13:06:11 -0400 Subject: [PATCH 4/7] Removed Python 3.3 from testing. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8e28829..f5930c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: python python: - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" env: From b72519e6d0ddbde8b4777f8346df5c143ddbd343 Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 13:15:22 -0400 Subject: [PATCH 5/7] Cleaned up Travis config. --- .travis.yml | 3 +-- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5930c1..5485d14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.6" - "2.7" - "3.4" - "3.5" @@ -9,6 +8,6 @@ env: - DJANGO=1.10 install: - pip install -q Django==$DJANGO - - pip install -q -e . + - python setup.py -q install script: - python setup.py test diff --git a/requirements.txt b/requirements.txt index 55b79ba..7be4927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Django>=1.9 django-setuptest>=0.2.1 requests>=2.11.0 -requests-oauthlib>=0.6.2 +requests-oauthlib>=0.6.2 \ No newline at end of file From d0b0ae6435cfd580669b57ef4ea770a4c0e098d1 Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 13:17:47 -0400 Subject: [PATCH 6/7] Fixed import error under 2.7. --- discord_bind/tests/test_models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/discord_bind/tests/test_models.py b/discord_bind/tests/test_models.py index e2a47d4..178369b 100644 --- a/discord_bind/tests/test_models.py +++ b/discord_bind/tests/test_models.py @@ -25,7 +25,10 @@ """ from __future__ import unicode_literals -from unittest.mock import patch, Mock +try: + from unittest.mock import patch, Mock +except ImportError: + from mock import patch, Mock from django.test import TestCase from django.contrib.auth.models import User, Group From 0c2e00348bfc7d7499628fac98ca35ed4bba1f9a Mon Sep 17 00:00:00 2001 From: Mark Rogaski Date: Sat, 13 Aug 2016 13:27:32 -0400 Subject: [PATCH 7/7] Added change log. --- CHANGELOG.md | 17 +++++++++++++++++ setup.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7787977 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +This project uses [Semantic Versioning](http://semver.org/). + +## [0.1.1] -- 2016-08-13 + +### Fixed +- Removed migration dependencies. +- Cleaned up TravisCI configuration. + + +## 0.1.0 -- 2016-08-13 + +Initial release. + + +[0.1.1]: https://github.com/mrogaski/django-discord-bind/compare/0.1.0...0.1.1 diff --git a/setup.py b/setup.py index 16e1d4a..378f444 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name='django-discord-bind', - version='0.1.0', + version='0.1.1', packages=find_packages(), include_package_data=True, license='MIT License', # example license