Skip to content

Commit 5d5b9c7

Browse files
authored
Merge pull request #497 from laixintao/fix-xgroup
add xgroup help command support.
2 parents d15de7e + 4a94b3f commit 5d5b9c7

File tree

9 files changed

+28
-23
lines changed

9 files changed

+28
-23
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v2
24-
- uses: actions/setup-python@v1
24+
- uses: actions/setup-python@v5
2525
with:
2626
python-version: 3.8
2727
architecture: 'x64'
@@ -75,7 +75,7 @@ jobs:
7575

7676
steps:
7777
- uses: actions/checkout@v2
78-
- uses: actions/setup-python@v1
78+
- uses: actions/setup-python@v5
7979
with:
8080
python-version: 3.8
8181
architecture: 'x64'

.github/workflows/test-binary-build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
options: --entrypoint redis-server
2222

2323
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions/setup-python@v1
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-python@v5
2626
with:
2727
python-version: 3.8
2828
architecture: 'x64'
2929
- name: Cache venv
30-
uses: actions/cache@v1
30+
uses: actions/cache@v4
3131
with:
3232
path: venv
3333
# Look to see if there is a cache hit for the corresponding requirements file
@@ -71,7 +71,7 @@ jobs:
7171
./build/x86*/release/install/iredis help GET
7272
7373
- name: Upload Release Asset to Github Artifact
74-
uses: actions/upload-artifact@v2
74+
uses: actions/upload-artifact@v4
7575
with:
7676
name: iredis-${{github.sha}}.tar.gz
7777
path: ./build/iredis.tar.gz

.github/workflows/test.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: ["ubuntu-20.04"]
15+
os: ["ubuntu-24.04"]
1616
python: ["3.8", "3.9", "3.10", "3.11.1", "3.12"]
1717
redis: [5, 6, 7, 7.2]
1818
runs-on: ${{ matrix.os }}
@@ -26,12 +26,12 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v2
29-
- uses: actions/setup-python@v4
29+
- uses: actions/setup-python@v5
3030
with:
3131
python-version: ${{ matrix.python }}
3232
architecture: "x64"
3333
- name: Cache venv
34-
uses: actions/cache@v2
34+
uses: actions/cache@v4
3535
with:
3636
path: venv
3737
# Look to see if there is a cache hit for the corresponding requirements file
@@ -62,13 +62,13 @@ jobs:
6262
- uses: codespell-project/actions-codespell@master
6363
with:
6464
ignore_words_list: fo,ists,oll,optin,ot,smove,tre,whe,EXAT,exat
65-
skip: ./docs/assets/demo.svg,./iredis/data/commands.json,./iredis/data/commands/*,./tests/unittests/*
66-
- uses: actions/setup-python@v4
65+
skip: ./docs/assets/demo.svg,./iredis/data/commands.json,./iredis/data/commands/*,./tests/unittests/*,./docs/assets/*
66+
- uses: actions/setup-python@v5
6767
with:
6868
python-version: 3.8
6969
architecture: "x64"
7070
- name: Cache venv
71-
uses: actions/cache@v2
71+
uses: actions/cache@v4
7272
with:
7373
path: venv
7474
# Look to see if there is a cache hit for the corresponding requirements file

iredis/commands.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ def split_command_args(command):
111111
112112
:param command: redis command string, with args
113113
"""
114-
global all_commands
115-
116114
command = command.strip()
117115
for command_name in all_commands:
118116
# for command that is partially input, like `command in`, we should

iredis/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ def read_config_file(f):
102102

103103

104104
def load_config_files(iredisrc):
105-
global config
106-
107105
with path(project_data, "iredisrc") as p:
108106
config_obj = ConfigObj(str(p))
109107

iredis/data/command_syntax.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ stream,XACK,command_key_group_ids,render_int
231231
stream,XADD,command_xadd,render_bulk_string
232232
stream,XCLAIM,command_xclaim,render_list
233233
stream,XDEL,command_key_ids,render_int
234-
stream,XGROUP,command_xgroup,render_string_or_int
234+
stream,XGROUP,command_xgroup,render_list_or_int_or_string
235235
stream,XINFO,command_xinfo,render_list
236236
stream,XLEN,command_key,render_int
237237
stream,XPENDING,command_xpending,render_list

iredis/entry.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
class SkipAuthFileHistory(FileHistory):
33-
"""Exactlly like FileHistory, but won't save `AUTH` command into history
33+
"""Exactly like FileHistory, but won't save `AUTH` command into history
3434
file."""
3535

3636
def append_string(self, string: str) -> None:
@@ -142,19 +142,19 @@ class Rainbow:
142142

143143
def __init__(self):
144144
self.current = -1
145-
self.forword = 1
145+
self.forward = 1
146146

147147
def __iter__(self):
148148
return self
149149

150150
def __next__(self):
151-
self.current += self.forword
151+
self.current += self.forward
152152
if 0 <= self.current < len(self.color):
153153
# not to the end
154154
return self.color[self.current]
155155
else:
156-
self.forword = -self.forword
157-
self.current += 2 * self.forword
156+
self.forward = -self.forward
157+
self.current += 2 * self.forward
158158
return self.color[self.current]
159159

160160

iredis/redis_grammar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ def c(const_name):
531531
(\s+ {STREAM_CREATE} \s+ {KEY} \s+ {GROUP} \s+ {STREAM_ID})|
532532
(\s+ {STREAM_SETID} \s+ {KEY} \s+ {GROUP} \s+ {STREAM_ID})|
533533
(\s+ {STREAM_DESTROY} \s+ {KEY} \s+ {GROUP})|
534-
(\s+ {STREAM_DELCONSUMER} \s+ {KEY} \s+ {GROUP} \s+ {CONSUMER})
534+
(\s+ {STREAM_DELCONSUMER} \s+ {KEY} \s+ {GROUP} \s+ {CONSUMER})|
535+
(\s+ {HELP})
535536
)
536537
\s*""",
537538
"command_key_group_ids": rf"""

iredis/renders.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ def render_list_or_string(text):
149149
return OutputRender.render_list(text)
150150
return OutputRender.render_bulk_string(text)
151151

152+
@staticmethod
153+
def render_list_or_int_or_string(text):
154+
if isinstance(text, list):
155+
return OutputRender.render_list(text)
156+
if isinstance(text, int):
157+
return OutputRender.render_int(text)
158+
return OutputRender.render_bulk_string(text)
159+
152160
@staticmethod
153161
def render_string_or_int(text):
154162
if isinstance(text, int):

0 commit comments

Comments
 (0)