1 |
commit: 6ee8fc8a081017567af281bde4c5ac82d5cf30ca |
2 |
Author: Tiziano Müller <dev-zero <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 22 15:07:30 2016 +0000 |
4 |
Commit: Tiziano Müller <dev-zero <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 22 15:07:30 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/dev/dev-zero.git/commit/?id=6ee8fc8a |
7 |
|
8 |
dev-python/flask-caching: initial commit |
9 |
|
10 |
dev-python/flask-caching/Manifest | 1 + |
11 |
...ching-1.0.0-disable-redis-memcached-tests.patch | 70 ++++++++++++++++++++++ |
12 |
.../flask-caching/flask-caching-1.0.0.ebuild | 33 ++++++++++ |
13 |
3 files changed, 104 insertions(+) |
14 |
|
15 |
diff --git a/dev-python/flask-caching/Manifest b/dev-python/flask-caching/Manifest |
16 |
new file mode 100644 |
17 |
index 0000000..3023764 |
18 |
--- /dev/null |
19 |
+++ b/dev-python/flask-caching/Manifest |
20 |
@@ -0,0 +1 @@ |
21 |
+DIST Flask-Caching-1.0.0.tar.gz 48496 SHA256 9894b14e9c6f487b3ca7aeacbc5887392f10f11b0e1de9c1f8133b003780c396 SHA512 3df43452de867fa3c7e482cb14f278b1e451bdac2226b2988a5cde6d78ca8ca113cc841284ae4a39f1e771e3d667df9117802aae3e66d84e497e5057a770bf57 WHIRLPOOL 65d61492115e556764cf31c2fa18171cb13d277cca752445df3b846fb2e8e0793abca23ce02395408233d81204216410303e62d7a0ef3310e871b9133006a412 |
22 |
|
23 |
diff --git a/dev-python/flask-caching/files/flask-caching-1.0.0-disable-redis-memcached-tests.patch b/dev-python/flask-caching/files/flask-caching-1.0.0-disable-redis-memcached-tests.patch |
24 |
new file mode 100644 |
25 |
index 0000000..e6a5dae |
26 |
--- /dev/null |
27 |
+++ b/dev-python/flask-caching/files/flask-caching-1.0.0-disable-redis-memcached-tests.patch |
28 |
@@ -0,0 +1,70 @@ |
29 |
+diff --git a/test_cache.py b/test_cache.py |
30 |
+index 22666a6..c76d66f 100644 |
31 |
+--- a/test_cache.py |
32 |
++++ b/test_cache.py |
33 |
+@@ -746,65 +746,6 @@ class CacheTestCase(unittest.TestCase): |
34 |
+ # print view_pie.cake_cache_key |
35 |
+ assert view_cake.cake_cache_key == view_pie.cake_cache_key |
36 |
+ |
37 |
+-try: |
38 |
+- import redis |
39 |
+- HAS_REDIS = True |
40 |
+-except ImportError: |
41 |
+- HAS_REDIS = False |
42 |
+- |
43 |
+-if sys.version_info <= (2, 7): |
44 |
+- class CacheMemcachedTestCase(CacheTestCase): |
45 |
+- def _set_app_config(self, app): |
46 |
+- app.config['CACHE_TYPE'] = 'memcached' |
47 |
+- |
48 |
+- class SpreadCacheMemcachedTestCase(CacheTestCase): |
49 |
+- def _set_app_config(self, app): |
50 |
+- app.config['CACHE_TYPE'] = 'spreadsaslmemcachedcache' |
51 |
+- |
52 |
+- |
53 |
+-class CacheRedisTestCase(CacheTestCase): |
54 |
+- def _set_app_config(self, app): |
55 |
+- app.config['CACHE_TYPE'] = 'redis' |
56 |
+- |
57 |
+- @unittest.skipUnless(HAS_REDIS, "requires Redis") |
58 |
+- def test_20_redis_url_default_db(self): |
59 |
+- config = { |
60 |
+- 'CACHE_TYPE': 'redis', |
61 |
+- 'CACHE_REDIS_URL': 'redis://localhost:6379', |
62 |
+- } |
63 |
+- cache = Cache() |
64 |
+- cache.init_app(self.app, config=config) |
65 |
+- from werkzeug.contrib.cache import RedisCache |
66 |
+- assert isinstance(self.app.extensions['cache'][cache], RedisCache) |
67 |
+- rconn = self.app.extensions['cache'][cache] \ |
68 |
+- ._client.connection_pool.get_connection('foo') |
69 |
+- assert rconn.db == 0 |
70 |
+- |
71 |
+- @unittest.skipUnless(HAS_REDIS, "requires Redis") |
72 |
+- def test_21_redis_url_custom_db(self): |
73 |
+- config = { |
74 |
+- 'CACHE_TYPE': 'redis', |
75 |
+- 'CACHE_REDIS_URL': 'redis://localhost:6379/2', |
76 |
+- } |
77 |
+- cache = Cache() |
78 |
+- cache.init_app(self.app, config=config) |
79 |
+- rconn = self.app.extensions['cache'][cache] \ |
80 |
+- ._client.connection_pool.get_connection('foo') |
81 |
+- assert rconn.db == 2 |
82 |
+- |
83 |
+- @unittest.skipUnless(HAS_REDIS, "requires Redis") |
84 |
+- def test_22_redis_url_explicit_db_arg(self): |
85 |
+- config = { |
86 |
+- 'CACHE_TYPE': 'redis', |
87 |
+- 'CACHE_REDIS_URL': 'redis://localhost:6379', |
88 |
+- 'CACHE_REDIS_DB': 1, |
89 |
+- } |
90 |
+- cache = Cache() |
91 |
+- cache.init_app(self.app, config=config) |
92 |
+- rconn = self.app.extensions['cache'][cache] \ |
93 |
+- ._client.connection_pool.get_connection('foo') |
94 |
+- assert rconn.db == 1 |
95 |
+- |
96 |
+ |
97 |
+ class CacheFilesystemTestCase(CacheTestCase): |
98 |
+ def _set_app_config(self, app): |
99 |
|
100 |
diff --git a/dev-python/flask-caching/flask-caching-1.0.0.ebuild b/dev-python/flask-caching/flask-caching-1.0.0.ebuild |
101 |
new file mode 100644 |
102 |
index 0000000..1896adf |
103 |
--- /dev/null |
104 |
+++ b/dev-python/flask-caching/flask-caching-1.0.0.ebuild |
105 |
@@ -0,0 +1,33 @@ |
106 |
+# Copyright 1999-2016 Gentoo Foundation |
107 |
+# Distributed under the terms of the GNU General Public License v2 |
108 |
+# $Id$ |
109 |
+ |
110 |
+EAPI=6 |
111 |
+PYTHON_COMPAT=( python2_7 python3_{3,4,5} ) |
112 |
+ |
113 |
+inherit distutils-r1 |
114 |
+ |
115 |
+MY_PN="Flask-Caching" |
116 |
+MY_P="${MY_PN}-${PV}" |
117 |
+ |
118 |
+DESCRIPTION="Adds caching support to your Flask application" |
119 |
+HOMEPAGE="https://pypi.python.org/pypi/Flask-Caching https://github.com/sh4nks/flask-caching" |
120 |
+SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz" |
121 |
+ |
122 |
+LICENSE="BSD" |
123 |
+SLOT="0" |
124 |
+KEYWORDS="~amd64 ~x86" |
125 |
+IUSE="test" |
126 |
+ |
127 |
+RDEPEND="dev-python/flask[${PYTHON_USEDEP}]" |
128 |
+DEPEND="${RDEPEND} |
129 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
130 |
+ " |
131 |
+ |
132 |
+PATCHES=( "${FILESDIR}/${P}-disable-redis-memcached-tests.patch" ) |
133 |
+ |
134 |
+S="${WORKDIR}/${MY_P}" |
135 |
+ |
136 |
+python_test() { |
137 |
+ esetup.py test |
138 |
+} |