From d312df1ef84a7a8df355d1496eef573a92958038 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 24 Apr 2025 14:19:19 +0200 Subject: [PATCH] Merging upstream version 1.15.1. Signed-off-by: Daniel Baumann --- .bumpversion.cfg | 2 +- .github/workflows/release.yaml | 8 ++++---- .github/workflows/test-binary-build.yaml | 8 ++++---- .github/workflows/test.yaml | 12 ++++++------ CHANGELOG.md | 4 ++++ iredis/__init__.py | 2 +- iredis/commands.py | 2 -- iredis/config.py | 2 -- iredis/data/command_syntax.csv | 2 +- iredis/entry.py | 10 +++++----- iredis/redis_grammar.py | 3 ++- iredis/renders.py | 8 ++++++++ poetry.lock | 13 +++++-------- pyproject.toml | 2 +- 14 files changed, 42 insertions(+), 36 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 210a124..02d7dea 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.15.0 +current_version = 1.15.1 commit = True tag = True diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d8b20c1..748ba00 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,12 +21,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: 3.8 architecture: 'x64' - name: Cache venv - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: venv # Look to see if there is a cache hit for the corresponding requirements file @@ -75,12 +75,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: 3.8 architecture: 'x64' - name: Cache venv - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: venv # Look to see if there is a cache hit for the corresponding requirements file diff --git a/.github/workflows/test-binary-build.yaml b/.github/workflows/test-binary-build.yaml index 1fbcd80..b77b075 100644 --- a/.github/workflows/test-binary-build.yaml +++ b/.github/workflows/test-binary-build.yaml @@ -21,13 +21,13 @@ jobs: options: --entrypoint redis-server steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.8 architecture: 'x64' - name: Cache venv - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: venv # Look to see if there is a cache hit for the corresponding requirements file @@ -71,7 +71,7 @@ jobs: ./build/x86*/release/install/iredis help GET - name: Upload Release Asset to Github Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: iredis-${{github.sha}}.tar.gz path: ./build/iredis.tar.gz diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6fb30ca..df0202d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-20.04"] + os: ["ubuntu-24.04"] python: ["3.8", "3.9", "3.10", "3.11.1", "3.12"] redis: [5, 6, 7, 7.2] runs-on: ${{ matrix.os }} @@ -26,12 +26,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} architecture: "x64" - name: Cache venv - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: venv # Look to see if there is a cache hit for the corresponding requirements file @@ -62,13 +62,13 @@ jobs: - uses: codespell-project/actions-codespell@master with: ignore_words_list: fo,ists,oll,optin,ot,smove,tre,whe,EXAT,exat - skip: ./docs/assets/demo.svg,./iredis/data/commands.json,./iredis/data/commands/*,./tests/unittests/* - - uses: actions/setup-python@v4 + skip: ./docs/assets/demo.svg,./iredis/data/commands.json,./iredis/data/commands/*,./tests/unittests/*,./docs/assets/* + - uses: actions/setup-python@v5 with: python-version: 3.8 architecture: "x64" - name: Cache venv - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: venv # Look to see if there is a cache hit for the corresponding requirements file diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d4c4d..0a00a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## UPCOMING +### 1.15.1 + +- Bugfix: fix `xgroup help` command output. + ## 1.15 - Dependency: remove pendulum, add `python-dateutil` (thanks to [deronnax]) diff --git a/iredis/__init__.py b/iredis/__init__.py index 6b0872c..8b0c915 100644 --- a/iredis/__init__.py +++ b/iredis/__init__.py @@ -1 +1 @@ -__version__ = "1.15.0" +__version__ = "1.15.1" diff --git a/iredis/commands.py b/iredis/commands.py index 481fc74..d02a263 100644 --- a/iredis/commands.py +++ b/iredis/commands.py @@ -111,8 +111,6 @@ def split_command_args(command): :param command: redis command string, with args """ - global all_commands - command = command.strip() for command_name in all_commands: # for command that is partially input, like `command in`, we should diff --git a/iredis/config.py b/iredis/config.py index 7a54220..f2b1672 100644 --- a/iredis/config.py +++ b/iredis/config.py @@ -102,8 +102,6 @@ def read_config_file(f): def load_config_files(iredisrc): - global config - with path(project_data, "iredisrc") as p: config_obj = ConfigObj(str(p)) diff --git a/iredis/data/command_syntax.csv b/iredis/data/command_syntax.csv index fbaf47b..579e26d 100644 --- a/iredis/data/command_syntax.csv +++ b/iredis/data/command_syntax.csv @@ -231,7 +231,7 @@ stream,XACK,command_key_group_ids,render_int stream,XADD,command_xadd,render_bulk_string stream,XCLAIM,command_xclaim,render_list stream,XDEL,command_key_ids,render_int -stream,XGROUP,command_xgroup,render_string_or_int +stream,XGROUP,command_xgroup,render_list_or_int_or_string stream,XINFO,command_xinfo,render_list stream,XLEN,command_key,render_int stream,XPENDING,command_xpending,render_list diff --git a/iredis/entry.py b/iredis/entry.py index b4615bb..852af05 100644 --- a/iredis/entry.py +++ b/iredis/entry.py @@ -30,7 +30,7 @@ logger = logging.getLogger(__name__) class SkipAuthFileHistory(FileHistory): - """Exactlly like FileHistory, but won't save `AUTH` command into history + """Exactly like FileHistory, but won't save `AUTH` command into history file.""" def append_string(self, string: str) -> None: @@ -142,19 +142,19 @@ class Rainbow: def __init__(self): self.current = -1 - self.forword = 1 + self.forward = 1 def __iter__(self): return self def __next__(self): - self.current += self.forword + self.current += self.forward if 0 <= self.current < len(self.color): # not to the end return self.color[self.current] else: - self.forword = -self.forword - self.current += 2 * self.forword + self.forward = -self.forward + self.current += 2 * self.forward return self.color[self.current] diff --git a/iredis/redis_grammar.py b/iredis/redis_grammar.py index 391cdd8..df837f0 100644 --- a/iredis/redis_grammar.py +++ b/iredis/redis_grammar.py @@ -531,7 +531,8 @@ GRAMMAR = { (\s+ {STREAM_CREATE} \s+ {KEY} \s+ {GROUP} \s+ {STREAM_ID})| (\s+ {STREAM_SETID} \s+ {KEY} \s+ {GROUP} \s+ {STREAM_ID})| (\s+ {STREAM_DESTROY} \s+ {KEY} \s+ {GROUP})| - (\s+ {STREAM_DELCONSUMER} \s+ {KEY} \s+ {GROUP} \s+ {CONSUMER}) + (\s+ {STREAM_DELCONSUMER} \s+ {KEY} \s+ {GROUP} \s+ {CONSUMER})| + (\s+ {HELP}) ) \s*""", "command_key_group_ids": rf""" diff --git a/iredis/renders.py b/iredis/renders.py index 9458263..55616b1 100644 --- a/iredis/renders.py +++ b/iredis/renders.py @@ -149,6 +149,14 @@ class OutputRender: return OutputRender.render_list(text) return OutputRender.render_bulk_string(text) + @staticmethod + def render_list_or_int_or_string(text): + if isinstance(text, list): + return OutputRender.render_list(text) + if isinstance(text, int): + return OutputRender.render_int(text) + return OutputRender.render_bulk_string(text) + @staticmethod def render_string_or_int(text): if isinstance(text, int): diff --git a/poetry.lock b/poetry.lock index 5f872e9..4ebcfdb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "async-timeout" @@ -38,18 +38,15 @@ files = [ [[package]] name = "configobj" -version = "5.0.8" +version = "5.0.9" description = "Config file reading, writing and validation." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.7" files = [ - {file = "configobj-5.0.8-py2.py3-none-any.whl", hash = "sha256:a7a8c6ab7daade85c3f329931a807c8aee750a2494363934f8ea84d8a54c87ea"}, - {file = "configobj-5.0.8.tar.gz", hash = "sha256:6f704434a07dc4f4dc7c9a745172c1cad449feb548febd9f7fe362629c627a97"}, + {file = "configobj-5.0.9-py2.py3-none-any.whl", hash = "sha256:1ba10c5b6ee16229c79a05047aeda2b55eb4e80d7c7d8ecf17ec1ca600c79882"}, + {file = "configobj-5.0.9.tar.gz", hash = "sha256:03c881bbf23aa07bccf1b837005975993c4ab4427ba57f959afdd9d1a2386848"}, ] -[package.dependencies] -six = "*" - [[package]] name = "exceptiongroup" version = "1.1.3" diff --git a/pyproject.toml b/pyproject.toml index 38c3e8e..fae2772 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "iredis" -version = "1.15.0" +version = "1.15.1" description = "Terminal client for Redis with auto-completion and syntax highlighting." authors = ["laixintao "] readme = 'README.md'