-
Notifications
You must be signed in to change notification settings - Fork 1
Minor update -> testing with redisvl #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| env: | ||
| UV_VERSION: "0.7.13" | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Style-check ${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: | ||
| - "3.9" | ||
| - "3.11" | ||
| - "3.13" | ||
|
|
||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| version: ${{ env.UV_VERSION }} | ||
| enable-cache: true | ||
| python-version: ${{ matrix.python-version }} | ||
| cache-dependency-glob: | | ||
| pyproject.toml | ||
| uv.lock | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv sync --frozen | ||
|
|
||
| - name: check-sort-import | ||
| run: | | ||
| make check-sort-imports | ||
|
|
||
| - name: check-black-format | ||
| run: | | ||
| make check-format | ||
|
|
||
| - name: check-mypy | ||
| run: | | ||
| make check-types | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Test Suite | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| UV_VERSION: "0.7.13" | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Python ${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, would remove 3.9. |
||
|
|
||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| version: ${{ env.UV_VERSION }} | ||
| enable-cache: true | ||
| python-version: ${{ matrix.python-version }} | ||
| cache-dependency-glob: | | ||
| pyproject.toml | ||
| uv.lock | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv sync | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| make test | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ wheels/ | |
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| .python-version | ||
|
|
||
| # Virtual environments | ||
| .venv/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| repos: | ||
| - repo: local | ||
| hooks: | ||
| - id: code-quality-checks | ||
| name: Run pre-commit checks (format, sort-imports, check-mypy) | ||
| entry: bash -c 'make format && make check-sort-imports && make check-types' | ||
| language: system | ||
| pass_filenames: false | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.2.6 | ||
| hooks: | ||
| - id: codespell | ||
| name: Check spelling | ||
| args: | ||
| - --write-changes | ||
| - --skip=*.pyc,*.pyo,*.lock,*.git,*.mypy_cache,__pycache__,*.egg-info,.pytest_cache,env,venv,.venv | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| .PHONY: install format lint test clean check-types check-format check-sort-imports sort-imports build help | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| # Allow passing arguments to make targets (e.g., make test ARGS="...") | ||
| ARGS ?= | ||
|
|
||
| install: ## Install the project and all dependencies | ||
| @echo "🚀 Installing project dependencies with uv" | ||
| uv sync | ||
|
|
||
| format: ## Format code with isort and black | ||
| @echo "🎨 Formatting code" | ||
| uv run isort ./sql_redis ./tests/ --profile black | ||
| uv run black ./sql_redis ./tests/ | ||
|
|
||
| check-format: ## Check code formatting | ||
| @echo "🔍 Checking code formatting" | ||
| uv run black --check ./sql_redis ./tests/ | ||
|
|
||
| sort-imports: ## Sort imports with isort | ||
| @echo "📦 Sorting imports" | ||
| uv run isort ./sql_redis ./tests/ --profile black | ||
|
|
||
| check-sort-imports: ## Check import sorting | ||
| @echo "🔍 Checking import sorting" | ||
| uv run isort ./sql_redis ./tests/ --check-only --profile black | ||
|
|
||
| check-types: ## Run mypy type checking | ||
| @echo "🔍 Running mypy type checking" | ||
| uv run python -m mypy ./sql_redis | ||
|
|
||
| lint: format check-types ## Run all linting (format + type check) | ||
|
|
||
| test: ## Run tests (pass extra args with ARGS="...") | ||
| @echo "🧪 Running tests" | ||
| uv run python -m pytest $(ARGS) | ||
|
|
||
| test-verbose: ## Run tests with verbose output | ||
| @echo "🧪 Running tests (verbose)" | ||
| uv run python -m pytest -vv -s $(ARGS) | ||
|
|
||
| test-cov: ## Run tests with coverage report | ||
| @echo "🧪 Running tests with coverage" | ||
| uv run python -m pytest --cov=sql_redis --cov-report=term-missing --cov-report=html $(ARGS) | ||
|
|
||
| check: lint test ## Run all checks (lint + test) | ||
|
|
||
| build: ## Build wheel and source distribution | ||
| @echo "🏗️ Building distribution packages" | ||
| uv build | ||
|
|
||
| clean: ## Clean up build artifacts and caches | ||
| @echo "🧹 Cleaning up directory" | ||
| find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name ".coverage" -delete 2>/dev/null || true | ||
| find . -type d -name "htmlcov" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name "dist" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name "build" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type f -name "*.log" -exec rm -rf {} + 2>/dev/null || true | ||
|
|
||
| help: ## Show this help message | ||
| @echo "Available commands:" | ||
| @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| """SQL to Redis command translation utility.""" | ||
|
|
||
| from sql_redis.translator import Translator, TranslatedQuery | ||
| from sql_redis.translator import TranslatedQuery, Translator | ||
|
|
||
| __all__ = ["Translator", "TranslatedQuery"] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might keep 3.10 and remove 3.9 here. Due to end-of-life timelines and such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heard. I relaxed because it was causing a dep graph issue since redisvl allows for lower version now