Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit 7e5c470

Browse files
committed
Merge pull request #137 from Grokzen/unstable
Release 1.2.0
2 parents 92810eb + e60997d commit 7e5c470

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4106
-1141
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ htmlcov
1010
dist
1111
build
1212
*.egg-info
13+
.cache
14+
docs/_build
15+
docs/_build_html

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@ sudo: false
22
language: python
33
python:
44
- "2.7"
5-
- "3.2"
65
- "3.3"
76
- "3.4"
87
- "3.5"
98
- "nightly"
109
services:
1110
- redis-server
1211
install:
13-
- make redis-install
12+
- "if [[ $REDIS_VERSION == '3.0' ]]; then REDIS_VERSION=3.0.7 make redis-install; fi"
13+
- "if [[ $REDIS_VERSION == '3.2' ]]; then REDIS_VERSION=3.2.0-rc3 make redis-install; fi"
1414
- pip install -r dev-requirements.txt
1515
- pip install -e .
16-
- "if [[ $TEST_HIREDIS == '1' ]]; then pip install hiredis; fi"
16+
- "if [[ $HIREDIS == '1' ]]; then pip install hiredis; fi"
1717
env:
18-
- TEST_HIREDIS=0
19-
- TEST_HIREDIS=1
18+
# Redis 3.0.6
19+
- HIREDIS=0 REDIS_VERSION=3.0
20+
# Redis 3.0.6 and HIREDIS
21+
- HIREDIS=1 REDIS_VERSION=3.0
22+
# Redis 3.2.0-rc3
23+
- HIREDIS=0 REDIS_VERSION=3.2
24+
# Redis 3.2.0-rc3 and HIREDIS
25+
- HIREDIS=1 REDIS_VERSION=3.2
2026
script:
2127
- make start
2228
- coverage erase

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
# Pull Request
3+
4+
For bug fixes you should provide some information about how to reproduce the problem so it can be verified if the new code solves the bug.
5+
6+
All CI tests must pass (Travis-CI)
7+
8+
Follow the code quality standards described in this file.
9+
10+
You are responsible for ensuring the code is mergable and fix any issues that can occur if other code was merged before your code.
11+
12+
Allways ensure docs is up to date based on your changes. If docs is missing and you think it should exists you are responsible to write it.
13+
14+
For all PR you should do/include the following
15+
- A line about the change in the `CHANGES` file Add it in the section `Next release`, create it if needed.
16+
- If you change something already implemented, for example add/remove argument you should add a line in `docs/Upgrading.md` describing how to migrate existing code from the old to the new code. Add it in the section `Next release`, create it if needed.
17+
- Add yourself to `docs/Authors` file (This is optional if you want)
18+
19+
20+
21+
# Code standard
22+
23+
In general, you should follow the established pep8 coding standard, but with the following exceptions/changes. https://www.python.org/dev/peps/pep-0008/
24+
25+
- The default max line length (80) should not be followed religiously. Instead try to not exceed ~140 characters.
26+
Use the `flake8` tool to ensure you have good code quality.
27+
- Try to document as much as possible in the method docstring and avoid doc inside the code. Code should describe itself as much as possible.
28+
- Follow the `KISS` rule and `Make it work first, optimize later`
29+
- When indenting, try to indent with json style. For example:
30+
```
31+
# Do not use this style
32+
from foo import (bar, qwe, rty,
33+
foobar, barfoo)
34+
35+
print("foobar {barfoo} {qwert}".format(barfoo=foo,
36+
qwerty=bar))
37+
```
38+
39+
```
40+
# Use this style instead
41+
from foo import (
42+
bar, qwe, rty,
43+
foobar, barfoo,
44+
)
45+
46+
print("foobar {barfoo} {qwert}".format(
47+
barfoo=foo, qwerty=bar))
48+
```
49+
50+
51+
52+
# Tests
53+
54+
I (Johan/Grokzen) have been allowed (by andymccurdy) explicitly to use all test code that already exists inside `redis-py` lib. If possible you should reuse code that exists in there.
55+
56+
All code should aim to have 100% test coverage. This is just a target and not a requirements.
57+
58+
All new features must implement tests to show that it works as intended.
59+
60+
All implemented tests must pass on all supported python versions. List of supported versions can be found in the `README.md`.
61+
62+
All tests should be assumed to work against the test environment that is implemented when running in `travis-ci`. Currently that means 6 nodes in the cluster, 3 masters, 3 slaves, using port `7000-7005` and the node on port `7000` must be accessible on `127.0.0.1`

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
exclude *.py
2+
include docs/authors.rst
23
include docs/License.txt
4+
include docs/release-notes.rst
35
include CHANGES
46
include setup.py
57
include README.md
6-
include docs/Authors

Makefile

Lines changed: 172 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,126 @@ cluster-enabled yes
9797
cluster-config-file /tmp/redis_cluster_node8.conf
9898
endef
9999

100+
101+
# CLUSTER REDIS PASSWORD PROTECTED NODES
102+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE1_CONF
103+
daemonize yes
104+
port 7100
105+
cluster-node-timeout 5000
106+
pidfile /tmp/redis_cluster_password_protected_node1.pid
107+
logfile /tmp/redis_cluster_password_protected_node1.log
108+
save ""
109+
masterauth password_is_protected
110+
requirepass password_is_protected
111+
appendonly no
112+
cluster-enabled yes
113+
cluster-config-file /tmp/redis_cluster_password_protected_node1.conf
114+
endef
115+
116+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE2_CONF
117+
daemonize yes
118+
port 7101
119+
cluster-node-timeout 5000
120+
pidfile /tmp/redis_cluster_password_protected_node2.pid
121+
logfile /tmp/redis_cluster_password_protected_node2.log
122+
save ""
123+
masterauth password_is_protected
124+
requirepass password_is_protected
125+
appendonly no
126+
cluster-enabled yes
127+
cluster-config-file /tmp/redis_cluster_password_protected_node2.conf
128+
endef
129+
130+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE3_CONF
131+
daemonize yes
132+
port 7102
133+
cluster-node-timeout 5000
134+
pidfile /tmp/redis_cluster_password_protected_node3.pid
135+
logfile /tmp/redis_cluster_password_protected_node3.log
136+
save ""
137+
masterauth password_is_protected
138+
requirepass password_is_protected
139+
appendonly no
140+
cluster-enabled yes
141+
cluster-config-file /tmp/redis_cluster_password_protected_node3.conf
142+
endef
143+
144+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE4_CONF
145+
daemonize yes
146+
port 7103
147+
cluster-node-timeout 5000
148+
pidfile /tmp/redis_cluster_password_protected_node4.pid
149+
logfile /tmp/redis_cluster_password_protected_node4.log
150+
save ""
151+
masterauth password_is_protected
152+
requirepass password_is_protected
153+
appendonly no
154+
cluster-enabled yes
155+
cluster-config-file /tmp/redis_cluster_password_protected_node4.conf
156+
endef
157+
158+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE5_CONF
159+
daemonize yes
160+
port 7104
161+
cluster-node-timeout 5000
162+
pidfile /tmp/redis_cluster_password_protected_node5.pid
163+
logfile /tmp/redis_cluster_password_protected_node5.log
164+
save ""
165+
masterauth password_is_protected
166+
requirepass password_is_protected
167+
appendonly no
168+
cluster-enabled yes
169+
cluster-config-file /tmp/redis_cluster_password_protected_node5.conf
170+
endef
171+
172+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE6_CONF
173+
daemonize yes
174+
port 7105
175+
cluster-node-timeout 5000
176+
pidfile /tmp/redis_cluster_password_protected_node6.pid
177+
logfile /tmp/redis_cluster_password_protected_node6.log
178+
save ""
179+
masterauth password_is_protected
180+
requirepass password_is_protected
181+
appendonly no
182+
cluster-enabled yes
183+
cluster-config-file /tmp/redis_cluster_password_protected_node6.conf
184+
endef
185+
186+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE7_CONF
187+
daemonize yes
188+
port 7106
189+
cluster-node-timeout 5000
190+
pidfile /tmp/redis_cluster_password_protected_node7.pid
191+
logfile /tmp/redis_cluster_password_protected_node7.log
192+
save ""
193+
masterauth password_is_protected
194+
requirepass password_is_protected
195+
appendonly no
196+
cluster-enabled yes
197+
cluster-config-file /tmp/redis_cluster_password_protected_node7.conf
198+
endef
199+
200+
define REDIS_CLUSTER_PASSWORD_PROTECTED_NODE8_CONF
201+
daemonize yes
202+
port 7107
203+
cluster-node-timeout 5000
204+
pidfile /tmp/redis_cluster_password_protected_node8.pid
205+
logfile /tmp/redis_cluster_password_protected_node8.log
206+
save ""
207+
masterauth password_is_protected
208+
requirepass password_is_protected
209+
appendonly no
210+
cluster-enabled yes
211+
cluster-config-file /tmp/redis_cluster_password_protected_node8.conf
212+
endef
213+
100214
ifndef REDIS_TRIB_RB
101-
REDIS_TRIB_RB=redis-git/src/redis-trib.rb
215+
REDIS_TRIB_RB=tests/redis-trib.rb
216+
endif
217+
218+
ifndef REDIS_VERSION
219+
REDIS_VERSION=3.0.7
102220
endif
103221

104222
export REDIS_CLUSTER_NODE1_CONF
@@ -110,10 +228,19 @@ export REDIS_CLUSTER_NODE6_CONF
110228
export REDIS_CLUSTER_NODE7_CONF
111229
export REDIS_CLUSTER_NODE8_CONF
112230

231+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE1_CONF
232+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE2_CONF
233+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE3_CONF
234+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE4_CONF
235+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE5_CONF
236+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE6_CONF
237+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE7_CONF
238+
export REDIS_CLUSTER_PASSWORD_PROTECTED_NODE8_CONF
239+
113240
help:
114241
@echo "Please use 'make <target>' where <target> is one of"
115242
@echo " clean remove temporary files created by build tools"
116-
@echo " cleanmeta removes all META-* and egg-info/ files created by build tools"
243+
@echo " cleanmeta removes all META-* and egg-info/ files created by build tools"
117244
@echo " cleancov remove all files related to coverage reports"
118245
@echo " cleanall all the above + tmp files from development tools"
119246
@echo " test run test suite"
@@ -167,12 +294,27 @@ start: cleanup
167294
echo "$$REDIS_CLUSTER_NODE6_CONF" | redis-server -
168295
echo "$$REDIS_CLUSTER_NODE7_CONF" | redis-server -
169296
echo "$$REDIS_CLUSTER_NODE8_CONF" | redis-server -
297+
298+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE1_CONF" | redis-server -
299+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE2_CONF" | redis-server -
300+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE3_CONF" | redis-server -
301+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE4_CONF" | redis-server -
302+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE5_CONF" | redis-server -
303+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE6_CONF" | redis-server -
304+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE7_CONF" | redis-server -
305+
echo "$$REDIS_CLUSTER_PASSWORD_PROTECTED_NODE8_CONF" | redis-server -
306+
170307
sleep 5
171308
echo "yes" | ruby $(REDIS_TRIB_RB) create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
309+
310+
sleep 5
311+
echo "yes" | ruby $(REDIS_TRIB_RB) create --replicas 1 --password password_is_protected 127.0.0.1:7100 127.0.0.1:7101 127.0.0.1:7102 127.0.0.1:7103 127.0.0.1:7104 127.0.0.1:7105
312+
172313
sleep 5
173314

174315
cleanup:
175316
- rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null
317+
- rm -vf /tmp/redis_cluster_password_protected_node*.conf 2>/dev/null
176318
- rm dump.rdb appendonly.aof - 2>/dev/null
177319

178320
stop:
@@ -184,6 +326,16 @@ stop:
184326
kill `cat /tmp/redis_cluster_node6.pid` || true
185327
kill `cat /tmp/redis_cluster_node7.pid` || true
186328
kill `cat /tmp/redis_cluster_node8.pid` || true
329+
330+
kill `cat /tmp/redis_cluster_password_protected_node1.pid` || true
331+
kill `cat /tmp/redis_cluster_password_protected_node2.pid` || true
332+
kill `cat /tmp/redis_cluster_password_protected_node3.pid` || true
333+
kill `cat /tmp/redis_cluster_password_protected_node4.pid` || true
334+
kill `cat /tmp/redis_cluster_password_protected_node5.pid` || true
335+
kill `cat /tmp/redis_cluster_password_protected_node6.pid` || true
336+
kill `cat /tmp/redis_cluster_password_protected_node7.pid` || true
337+
kill `cat /tmp/redis_cluster_password_protected_node8.pid` || true
338+
187339
rm -f /tmp/redis_cluster_node1.conf
188340
rm -f /tmp/redis_cluster_node2.conf
189341
rm -f /tmp/redis_cluster_node3.conf
@@ -193,6 +345,15 @@ stop:
193345
rm -f /tmp/redis_cluster_node7.conf
194346
rm -f /tmp/redis_cluster_node8.conf
195347

348+
rm -f /tmp/redis_cluster_password_protected_node1.conf
349+
rm -f /tmp/redis_cluster_password_protected_node2.conf
350+
rm -f /tmp/redis_cluster_password_protected_node3.conf
351+
rm -f /tmp/redis_cluster_password_protected_node4.conf
352+
rm -f /tmp/redis_cluster_password_protected_node5.conf
353+
rm -f /tmp/redis_cluster_password_protected_node6.conf
354+
rm -f /tmp/redis_cluster_password_protected_node7.conf
355+
rm -f /tmp/redis_cluster_password_protected_node8.conf
356+
196357
test:
197358
make start
198359
make tox
@@ -201,11 +362,16 @@ test:
201362
tox:
202363
coverage erase
203364
tox
365+
TEST_PASSWORD_PROTECTED=1 tox
204366
coverage combine
205367
coverage report
206368

369+
clone-redis:
370+
[ ! -e redis-git ] && git clone https://github.com/antirez/redis.git redis-git || true
371+
cd redis-git && git checkout $(REDIS_VERSION)
372+
207373
redis-install:
208-
[ ! -e redis-git ] && git clone --depth 1 https://github.com/antirez/redis.git redis-git || true
374+
make clone-redis
209375
make -C redis-git -j4
210376
gem install redis
211377
sleep 3
@@ -224,4 +390,7 @@ benchmark:
224390
@echo " -- Running Simple benchmark with StrictRedisCluster lib and cluster server"
225391
python benchmarks/simple.py --port 7001 --timeit --pipeline
226392

393+
ptp:
394+
python ptp-debug.py
395+
227396
.PHONY: test

0 commit comments

Comments
 (0)