[python-django-keyedcache] Works with Django 1.4

Miro Hrončok churchyard at fedoraproject.org
Mon Apr 22 09:50:33 UTC 2013


commit 8c0027068ab7f790397fe57853217ff1ee020ef2
Author: Miro Hrončok <miro at hroncok.cz>
Date:   Mon Apr 22 11:50:08 2013 +0200

    Works with Django 1.4

 python-django-keyedcache-hashlib.patch |   30 ++++++++++++++++++++++++++++++
 python-django-keyedcache-secret.patch  |   19 +++++++++++++++++++
 python-django-keyedcache.spec          |   13 ++++++++++++-
 3 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/python-django-keyedcache-hashlib.patch b/python-django-keyedcache-hashlib.patch
new file mode 100644
index 0000000..26c9214
--- /dev/null
+++ b/python-django-keyedcache-hashlib.patch
@@ -0,0 +1,30 @@
+# HG changeset patch
+# User Vladimir Dmitriev <vldmit at gmail.com>
+# Date 1364455211 -14400
+# Node ID e10dfda01e8f5e1f0042d00e0d753e44c2627e64
+# Parent  49f24c71151893549d42a30adf706b986ad1ac94
+Moved to hashlib to remove DeprecationWarning
+
+diff -r 49f24c71151893549d42a30adf706b986ad1ac94 -r e10dfda01e8f5e1f0042d00e0d753e44c2627e64 keyedcache/__init__.py
+--- a/keyedcache/__init__.py	Fri Feb 24 06:14:31 2012 +0100
++++ b/keyedcache/__init__.py	Thu Mar 28 11:20:11 2013 +0400
+@@ -18,9 +18,9 @@
+ from django.conf import settings
+ from django.core.cache import cache
+ from django.utils.encoding import smart_str
+-from django.utils.hashcompat import md5_constructor
+ from keyedcache.utils import is_string_like, is_list_or_tuple
+ import cPickle as pickle
++import hashlib
+ import logging
+ import types
+ 
+@@ -353,7 +353,7 @@
+ 
+ def md5_hash(obj):
+     pickled = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
+-    return md5_constructor(pickled).hexdigest()
++    return hashlib.md5(pickled).hexdigest()
+ 
+ 
+ def is_memcached_backend():
diff --git a/python-django-keyedcache-secret.patch b/python-django-keyedcache-secret.patch
new file mode 100644
index 0000000..00d1d17
--- /dev/null
+++ b/python-django-keyedcache-secret.patch
@@ -0,0 +1,19 @@
+# HG changeset patch
+# User Miro Hrončok <miro at hroncok.cz>
+# Date 1366583813 -7200
+# Node ID 581cc36a9eb750168fb7010b3b07bd72fa825d24
+# Parent  e10dfda01e8f5e1f0042d00e0d753e44c2627e64
+Set SECRET_KEY to 'secret' so Django 1.5 won't complain.
+
+diff -r e10dfda01e8f5e1f0042d00e0d753e44c2627e64 -r 581cc36a9eb750168fb7010b3b07bd72fa825d24 keyedcache/test_app/settings.py
+--- a/keyedcache/test_app/settings.py	Thu Mar 28 11:20:11 2013 +0400
++++ b/keyedcache/test_app/settings.py	Mon Apr 22 00:36:53 2013 +0200
+@@ -47,7 +47,7 @@
+ ADMIN_MEDIA_PREFIX = '/media/'
+ 
+ # Make this unique, and don't share it with anybody.
+-SECRET_KEY = ''
++SECRET_KEY = 'secret'
+ 
+ # List of callables that know how to import templates from various sources.
+ TEMPLATE_LOADERS = (
diff --git a/python-django-keyedcache.spec b/python-django-keyedcache.spec
index f0c8349..e520ecf 100644
--- a/python-django-keyedcache.spec
+++ b/python-django-keyedcache.spec
@@ -4,13 +4,19 @@
 
 Name:           python-%{pypi_name}
 Version:        1.4.6
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Utilities for simplified development of cache aware objects
 Group:          Development/Languages
 License:        BSD
 URL:            http://pypi.python.org/pypi/%{pypi_name}
 Source0:        http://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{srcversion}.tar.gz
 
+# Patch for Django 1.5, that simply sets SECRET_KEY to 'secret' in test app settings
+Patch0:         %{name}-secret.patch
+
+# Pacth from upstream's hg: Moved to hashlib to remove DeprecationWarning
+Patch1:         %{name}-hashlib.patch
+
 BuildArch:      noarch
 BuildRequires:  python-setuptools
 BuildRequires:  python2-devel
@@ -27,6 +33,8 @@ of cache-aware objects. Used in Satchmo
 
 %prep
 %setup -q -n %{pypi_name}-%{srcversion}
+%patch0 -p1
+%patch1 -p1
 rm -rf tests
 
 %build
@@ -63,6 +71,9 @@ popd
 %{python_sitelib}/django_keyedcache*.egg-info
 
 %changelog
+* Sun Apr 21 2013 Miro Hrončok <mhroncok at redhat.com> - 1.4.6-5
+- Added patches so this works with Django 1.5 well
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.6-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list