Skip to content

Commit 4c49602

Browse files
committed
feat: enhance CLI functionality and improve CI/CD reliability
- Introduced full CLI command suite including ping, stats, list, flush, search, export-config, and warm - Improved CLI architecture with proper command registration - Updated Python requirement to 3.9 in contributing guidelines and configuration files - Enhanced GitHub Actions workflow for better CI/CD reliability - Fixed Redis connection handling and CLI command registration issues - Updated documentation with new CLI commands and usage examples
1 parent e501849 commit 4c49602

File tree

7 files changed

+36
-9
lines changed

7 files changed

+36
-9
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ jobs:
9393
9494
- name: Test CLI
9595
run: |
96-
python -m yokedcache.cli ping
97-
python -m yokedcache.cli stats --format json
96+
python -m yokedcache ping
97+
python -m yokedcache stats --format json

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- Comprehensive test suite with pytest
2727
- Documentation and usage examples
2828
- Development tooling (pre-commit, Makefile, CI/CD)
29+
- CLI module execution support via `python -m yokedcache`
30+
- Full CLI command suite: ping, stats, list, flush, search, export-config, warm
2931

3032
### Changed
31-
- N/A (initial release)
33+
- Improved CLI architecture with proper command registration
34+
- Enhanced GitHub Actions workflow for better CI/CD reliability
3235

3336
### Deprecated
3437
- N/A (initial release)
3538

3639
### Removed
37-
- N/A (initial release)
40+
- Codecov integration temporarily disabled due to rate limiting issues
3841

3942
### Fixed
40-
- N/A (initial release)
43+
- Redis connection method: changed from `aclose()` to `close()` for proper async connection handling
44+
- CLI command registration issue with async decorators using `functools.wraps`
45+
- Black code formatting compliance across all source files
46+
- MyPy type checking errors for Redis client methods
47+
- GitHub Actions integration test failures with CLI module execution
4148

4249
### Security
4350
- N/A (initial release)

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We welcome contributions to YokedCache! This document provides guidelines for co
66

77
### Prerequisites
88

9-
- Python 3.8 or higher
9+
- Python 3.9 or higher
1010
- Redis server
1111
- Git
1212

@@ -65,7 +65,7 @@ isort src tests examples
6565
flake8 src tests examples
6666

6767
# Type checking
68-
mypy src
68+
mypy src --ignore-missing-imports
6969
```
7070

7171
### Running Tests
@@ -137,7 +137,7 @@ For new features:
137137
pytest
138138
black src tests examples
139139
flake8 src tests examples
140-
mypy src
140+
mypy src --ignore-missing-imports
141141
```
142142

143143
6. **Commit your changes** with a clear commit message:

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ YokedCache includes a powerful CLI for cache management:
177177
# View cache statistics
178178
yokedcache stats --watch
179179

180+
# Test Redis connection
181+
yokedcache ping
182+
180183
# List cached keys
181184
yokedcache list --pattern "user:*"
182185

@@ -188,6 +191,12 @@ yokedcache search "alice" --threshold 80
188191

189192
# Monitor in real-time (JSON output for dashboards)
190193
yokedcache stats --format json
194+
195+
# Export current configuration
196+
yokedcache export-config --output config.yaml
197+
198+
# Warm cache with predefined data
199+
yokedcache warm --config-file cache_config.yaml
191200
```
192201

193202
## 🚀 **Performance**

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ packages = ["src/yokedcache"]
8787

8888
[tool.black]
8989
line-length = 88
90-
target-version = ["py38"]
90+
target-version = ["py39"]
9191
include = '\.pyi?$'
9292

9393
[tool.isort]

src/yokedcache/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""
2+
Entry point for running YokedCache CLI via `python -m yokedcache`.
3+
"""
4+
5+
import sys
6+
from .cli import main
7+
8+
if __name__ == "__main__":
9+
main()

src/yokedcache/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import asyncio
9+
import functools
910
import json
1011
import sys
1112
import time
@@ -48,6 +49,7 @@ def get_cache_instance(
4849
def async_command(f):
4950
"""Decorator to handle async commands."""
5051

52+
@functools.wraps(f)
5153
@click.pass_context
5254
def wrapper(ctx, *args, **kwargs):
5355
return asyncio.run(f(ctx, *args, **kwargs))

0 commit comments

Comments
 (0)