Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
strategy:
max-parallel: 15
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12', '3.13']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Python ${{ matrix.python-version }} test
steps:
- uses: actions/checkout@v2
- name: install python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: cache
uses: actions/cache@v1
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
TAG: ${{ github.event.release.tag_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT

- name: Set up Python 3.7
uses: actions/setup-python@v4
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.14

- name: Cache Poetry virtualenv
uses: actions/cache@v1
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
Expand Down
8 changes: 5 additions & 3 deletions RAMP/commands_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ def _load_module(redis_client, path_to_module, module_args):
:param path_to_module: where does the module file is located.
Assuming only a single module is loaded.
"""
previously_loaded_modules = _get_modules_list(redis_client)
resp = redis_client.execute_command("MODULE LOAD {} {}".format(
os.path.abspath(path_to_module), module_args))
if resp != OK:
return None

loaded_modules = _get_modules_list(redis_client)
if len(loaded_modules) != 1:
relevant_module_list = [x for x in loaded_modules if x not in previously_loaded_modules]
if len(relevant_module_list) != 1:
return None

loaded_modules = loaded_modules[0]
return Module(loaded_modules[0], loaded_modules[1])
module_name, module_version = relevant_module_list[0]
return Module(module_name, module_version)

def _get_redis_commands(redis_client):
"""
Expand Down
4 changes: 2 additions & 2 deletions RAMP/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pkg_resources
try:
VERSION = pkg_resources.get_distribution("ramp-packer").version
from importlib.metadata import version
VERSION = version("ramp-packer")
except:
VERSION = "99.99.99"
8 changes: 5 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ def validate_module_commands(commands):
expected_command.append({"command_arity": -1,
"command_name": "graph.QUERY",
"first_key": 1,
"flags": ["write","denyoom","noscript"],
"flags": ["write", "denyoom", "module", "noscript"],
"last_key": 1,
"step": 1})

expected_command.append({"command_arity": -1,
"command_name": "graph.DELETE",
"first_key": 1,
"flags": ["write","noscript"],
"flags": ["write","module","noscript"],
"last_key": 1,
"step": 1})

expected_command.append({"command_name": "test"})

assert sorted(expected_command, key=lambda c: c['command_name']) == sorted(commands, key=lambda c: c['command_name'])
expected_set = sorted(expected_command, key=lambda c: c['command_name'])
actual_set = sorted(commands, key=lambda c: c['command_name'])
assert expected_set == actual_set

def test_defaults():
"""Test auto generated metadata from module is as expected."""
Expand Down