Skip to content

Commit 9546134

Browse files
authored
Merge pull request gusdan#3 from uncovertruth/fix/ci_passed
Pass CI
2 parents 4263c21 + 87764a3 commit 9546134

File tree

12 files changed

+143
-75
lines changed

12 files changed

+143
-75
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ matrix:
4242
env: TOXENV=isort
4343
- python: 3.6
4444
env: TOXENV=readme
45+
- python: 3.6
46+
env: TOXENV=check-manifest
4547
allow_failures:
4648
- env: TOX_ENV=py35-djdev
4749
- env: TOX_ENV=py36-djdev

MANIFEST.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
include README.md
2-
include MANIFEST.in
3-
include setup.py
1+
graft django_elastipymemcache
2+
graft tests
3+
include README.rst AUTHORS LICENSE CHANGELOG.rst setup.py setup.cfg requirements.txt tox.ini
4+
global-exclude __pycache__ *.pyc

README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
=======================
2+
django-elastipymemcache
3+
=======================
4+
5+
:Info: Simple Django cache backend for Amazon ElastiCache (memcached based).
6+
:Author: UNCOVER TRUTH Inc. <develop@uncovertruth.co.jp>
7+
:Copyright: © UNCOVER TRUTH Inc.
8+
:Date: 2017-04-11
9+
:Version: 0.0.1
10+
11+
.. index: README
12+
.. image:: https://travis-ci.org/uncovertruth/django-elastipymemcache.svg?branch=master
13+
:target: https://travis-ci.org/uncovertruth/django-elastipymemcache
14+
.. image:: https://codecov.io/gh/uncovertruth/django-elastipymemcache/branch/master/graph/badge.svg
15+
:target: https://codecov.io/gh/uncovertruth/django-elastipymemcache
16+
17+
Purpose
18+
-------
19+
20+
Simple Django cache backend for Amazon ElastiCache (memcached based). It uses
21+
`pymemcache <https://github.com/pinterest/pymemcache>`_ and sets up a connection to each
22+
node in the cluster using
23+
`auto discovery <http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html>`_.
24+
Originally forked from `django-elasticache <https://github.com/gusdan/django-elasticache>`_.
25+
26+
Requirements
27+
------------
28+
29+
* pymemcache
30+
* Django>=1.8
31+
32+
Installation
33+
------------
34+
35+
Get it from `pypix <http://pypi.python.org/pypi/django-elastipymemcache>`_::
36+
37+
pip install django-elastipymemcache
38+
39+
Usage
40+
-----
41+
42+
Your cache backend should look something like this::
43+
44+
CACHES = {
45+
'default': {
46+
'BACKEND': 'django_elastipymemcache.memcached.ElastiPyMemCache',
47+
'LOCATION': '[configuration endpoint].com:11211',
48+
}
49+
}
50+
51+
Testing
52+
-------
53+
54+
Run the tests like this::
55+
56+
nosetests

django_elastipymemcache/cluster_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"""
22
utils for discovery cluster
33
"""
4-
from distutils.version import StrictVersion
5-
from django.utils.encoding import smart_text
64
import re
5+
from distutils.version import StrictVersion
76
from telnetlib import Telnet
87

8+
from django.utils.encoding import smart_text
9+
910

1011
class WrongProtocolData(ValueError):
1112
"""

django_elastipymemcache/memcached.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def get_cluster_nodes(self):
7171
@property
7272
def _cache(self):
7373
if getattr(self, '_client', None) is None:
74-
self._client = self._lib.Client(self.get_cluster_nodes(), **self._options)
74+
self._client = self._lib.Client(
75+
self.get_cluster_nodes(), **self._options)
7576
return self._client
7677

7778
@invalidate_cache_after_error

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nose
2+
coverage
3+
flake8
4+
isort
5+
readme_renderer
6+
check-manifest

setup.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[wheel]
2+
universal = 1
3+
4+
[isort]
5+
include_trailing_comma=True
6+
line_length=80
7+
multi_line_output=3
8+
not_skip=__init__.py
9+
known_first_party=django_elastipymemcache
10+
11+
[check-manifest]
12+
ignore =
13+
*.swp
14+
15+
[coverage:run]
16+
branch = True
17+
omit = tests/*

setup.py

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,47 @@
1-
from setuptools import setup
1+
#!/usr/bin/env python
2+
# -*- encoding: utf-8 -*-
23

3-
import django_elastipymemcache
4+
import io
5+
6+
from setuptools import find_packages, setup
47

8+
import django_elastipymemcache
59

610
setup(
711
name='django-elastipymemcache',
812
version=django_elastipymemcache.__version__,
913
description='Django cache backend for Amazon ElastiCache (memcached)',
10-
long_description=open('README.md').read(),
11-
author='Danil Gusev',
12-
platforms='any',
13-
author_email='info@uncovertruth.jp',
14+
keywords='elasticache amazon cache pymemcache memcached aws',
15+
author='UNCOVER TRUTH Inc.',
16+
author_email='develop@uncovertruth.co.jp',
1417
url='http://github.com/uncovertruth/django-elastipymemcache',
1518
license='MIT',
16-
keywords='elasticache amazon cache pymemcache memcached aws',
17-
packages=['django_elastipymemcache'],
18-
install_requires=['pymemcache', 'Django>=1.8'],
19+
long_description=io.open('README.rst').read(),
20+
platforms='any',
21+
zip_safe=False,
1922
classifiers=[
2023
'Development Status :: 4 - Beta',
2124
'Environment :: Web Environment',
22-
'Environment :: Web Environment :: Mozilla',
23-
'Framework :: Django',
25+
'Framework :: Django :: 1.8',
26+
'Framework :: Django :: 1.9',
27+
'Framework :: Django :: 1.10',
28+
'Framework :: Django :: 1.11',
2429
'Intended Audience :: Developers',
25-
'License :: OSI Approved :: BSD License',
30+
'License :: OSI Approved :: MIT License',
2631
'Operating System :: OS Independent',
27-
'Programming Language :: Python',
32+
'Programming Language :: Python :: 2',
33+
'Programming Language :: Python :: 2.7',
34+
'Programming Language :: Python :: 3',
35+
'Programming Language :: Python :: 3.3',
36+
'Programming Language :: Python :: 3.4',
37+
'Programming Language :: Python :: 3.5',
38+
'Programming Language :: Python :: 3.6',
2839
'Topic :: Software Development :: Libraries :: Python Modules',
2940
],
41+
packages=find_packages(exclude=('tests',)),
42+
include_package_data=True,
43+
install_requires=[
44+
'pymemcache',
45+
'Django>=1.8',
46+
],
3047
)

tests/test_backend.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from django.conf import global_settings, settings
2-
from nose.tools import eq_, raises
31
import sys
2+
3+
from django.conf import global_settings, settings
4+
from nose.tools import eq_
5+
46
if sys.version < '3':
57
from mock import patch, Mock
68
else:

0 commit comments

Comments
 (0)