-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from michaelkuty/master
- Loading branch information
Showing
11 changed files
with
74 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ dist/* | |
.coverage | ||
TODO | ||
.tox | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
language: python | ||
python: 2.7 | ||
sudo: false | ||
|
||
python: | ||
- 2.7 | ||
- 3.3 | ||
- 3.4 | ||
- "pypy" | ||
env: | ||
- TOX_ENV=py27-django15 | ||
- TOX_ENV=py27-django16 | ||
- TOX_ENV=py27-django17 | ||
- TOX_ENV=py27-django18 | ||
- TOX_ENV=py33-django15 | ||
- TOX_ENV=py33-django16 | ||
- TOX_ENV=py33-django17 | ||
- TOX_ENV=py33-django18 | ||
- TOX_ENV=py34-django15 | ||
- TOX_ENV=py34-django16 | ||
- TOX_ENV=py34-django17 | ||
- TOX_ENV=py34-django18 | ||
- TOX_ENV=pypy-django15 | ||
- TOX_ENV=pypy-django16 | ||
- TOX_ENV=pypy-django17 | ||
- TOX_ENV=pypy-django18 | ||
- TOX_ENV=py27-django14 | ||
|
||
install: | ||
- make test | ||
- pip install tox | ||
|
||
script: | ||
- ./runtests.py | ||
- tox -e $TOX_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
__version__ = '1.0-dev' | ||
|
||
default_app_config = 'cacheback.conf.CachebackConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.apps import AppConfig | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class CachebackConfig(AppConfig): | ||
name = 'cacheback' | ||
verbose_name = _('Cacheback') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from django.core import signals | ||
|
||
|
||
def get_cache(backend, **kwargs): | ||
""" | ||
Compatibilty wrapper for getting Django's cache backend instance | ||
original source: https://github.com/vstoykov/django-imagekit/commit/c26f8a0538778969a64ee471ce99b25a04865a8e | ||
""" | ||
try: | ||
from django.core.cache import _create_cache | ||
except ImportError: | ||
# Django < 1.7 | ||
from django.core.cache import get_cache as _get_cache | ||
return _get_cache(backend, **kwargs) | ||
|
||
cache = _create_cache(backend, **kwargs) | ||
# Some caches -- python-memcached in particular -- need to do a cleanup at the | ||
# end of a request cycle. If not implemented in a particular backend | ||
# cache.close is a no-op | ||
signals.request_finished.connect(cache.close) | ||
return cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
django-nose==1.3 | ||
django-nose==1.4.1 | ||
nose==1.3.4 | ||
pinocchio==0.4.2 | ||
mock==1.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
[tox] | ||
envlist=py27,py34,pypy | ||
envlist=py{27,33,34,py}-django{15,16,17,18},py27-django14 | ||
|
||
[testenv] | ||
deps = -r{toxinidir}/test_requirements.txt | ||
deps = | ||
-r{toxinidir}/test_requirements.txt | ||
django14: Django>=1.4,<1.5 | ||
django15: Django>=1.5,<1.6 | ||
django16: Django>=1.6,<1.7 | ||
django17: Django>=1.7,<1.8 | ||
django18: Django==1.8.3 | ||
commands = python runtests.py [] | ||
|
||
[testenv:py27] | ||
basepython = python2.7 | ||
|
||
[testenv:py34] | ||
basepython = python3.4 | ||
|
||
[testenv:pypy] | ||
basepython = pypy |