From 2cb022615a9ec84e2d238f048d262d72bccaf729 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:42:37 -0500 Subject: [PATCH 01/27] Update dependabot.yml --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bb54515c..228461e6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,7 @@ updates: labels: - dependencies schedule: - interval: "weekly" + interval: "daily" # Maintain dependencies for Python - package-ecosystem: "pip" @@ -15,5 +15,5 @@ updates: labels: - dependencies schedule: - interval: "weekly" + interval: "daily" open-pull-requests-limit: 10 From 30e0c9d09ebb5342e09cdb06ac3f7e000caa0abd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 02:43:27 +0000 Subject: [PATCH 02/27] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/pypi-publish.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d67f57e0..2fd7065f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Setup Python 3.9 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{env.pythonversion}} #---------------------------------------------- @@ -100,7 +100,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Setup Python ${{ matrix.pyver }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.pyver }} #---------------------------------------------- diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index 415a4370..867e14e7 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -27,7 +27,7 @@ jobs: value: "${{ steps.get_version.outputs.VERSION }}" - name: Set up Python 3.9 - uses: actions/setup-python@v4.3.0 + uses: actions/setup-python@v5 with: python-version: 3.9 From d2620e2c12616334a713f2474ec201917e9e78aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 02:43:30 +0000 Subject: [PATCH 03/27] Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/pypi-publish.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d67f57e0..a5c1edc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: #---------------------------------------------- - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} @@ -117,7 +117,7 @@ jobs: #---------------------------------------------- - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index 415a4370..bc0a0ffd 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -32,7 +32,7 @@ jobs: python-version: 3.9 - name: Cache Poetry virtualenv - uses: actions/cache@v3.0.11 + uses: actions/cache@v4 id: cache with: path: ~/.virtualenvs From 90c23398156373a0cc320bfc27194b89b3e8f1ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 02:43:33 +0000 Subject: [PATCH 04/27] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 34849130..615ea3f2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,9 +29,9 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 858d5d58d33095863dd7875f04aa4cb3fb4a392f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 02:43:36 +0000 Subject: [PATCH 05/27] Bump rojopolis/spellcheck-github-actions from 0.33.1 to 0.36.0 Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.33.1 to 0.36.0. - [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases) - [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md) - [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.33.1...0.36.0) --- updated-dependencies: - dependency-name: rojopolis/spellcheck-github-actions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/spellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index e1528415..b99e3616 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -8,7 +8,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Check Spelling - uses: rojopolis/spellcheck-github-actions@0.33.1 + uses: rojopolis/spellcheck-github-actions@0.36.0 with: config_path: .github/spellcheck-settings.yml task_name: Markdown From 2228a6ba668f9ab71eb97403692b832345db1b55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 02:44:24 +0000 Subject: [PATCH 06/27] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- .github/workflows/spellcheck.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f995df4e..03186fdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python 3.9 uses: actions/setup-python@v5 with: @@ -98,7 +98,7 @@ jobs: INSTALL_DIR: ${{ github.workspace }}/redis steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python ${{ matrix.pyver }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 34849130..6b8b658a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index e1528415..3bd776cf 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check Spelling uses: rojopolis/spellcheck-github-actions@0.33.1 with: From 24897f62589a43c112629dccd3544083dc760313 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 02:44:53 +0000 Subject: [PATCH 07/27] Update pytest-asyncio requirement from ^0.20.3 to ^0.23.5 Updates the requirements on [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.20.3...v0.23.5) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 54d3b272..ce8b7885 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ coverage = "^7.1" pytest-cov = "^4.0.0" pytest-xdist = "^3.1.0" unasync = "^0.5.0" -pytest-asyncio = "^0.20.3" +pytest-asyncio = "^0.23.5" email-validator = "^2.0.0" tox = "^3.26.0" tox-pyenv = "^1.1.0" From 188f0a2988941d57dbb0125b417f333efcd59285 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:51:25 -0500 Subject: [PATCH 08/27] Add py3.12 and pypy-3.10 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03186fdc..68d52b81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - pyver: [ "3.8", "3.9", "3.10", "3.11", "pypy-3.8", "pypy-3.9" ] + pyver: [ "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9", "pypy-3.10" ] redisstack: [ "latest" ] fail-fast: false services: From 34933ed267718b2e3548770a9a5c755516fc0987 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:04:22 +0000 Subject: [PATCH 09/27] Update pytest requirement from ^7.1.3 to ^8.0.2 Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.1.3...8.0.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ce8b7885..b9dbef8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ more-itertools = ">=8.14,<10.0" [tool.poetry.dev-dependencies] mypy = "^0.982" -pytest = "^7.1.3" +pytest = "^8.0.2" ipdb = "^0.13.9" black = "^23.1" isort = "^5.9.3" From a5af2f7bba6affa6baa5bbe304570f8a54604ea3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:13:45 +0000 Subject: [PATCH 10/27] Update more-itertools requirement from >=8.14,<10.0 to >=8.14,<11.0 Updates the requirements on [more-itertools](https://github.com/more-itertools/more-itertools) to permit the latest version. - [Release notes](https://github.com/more-itertools/more-itertools/releases) - [Commits](https://github.com/more-itertools/more-itertools/compare/v8.14.0...v10.2.0) --- updated-dependencies: - dependency-name: more-itertools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b9dbef8e..b830fecf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ types-redis = ">=3.5.9,<5.0.0" python-ulid = "^1.0.3" typing-extensions = "^4.4.0" hiredis = "^2.2.3" -more-itertools = ">=8.14,<10.0" +more-itertools = ">=8.14,<11.0" [tool.poetry.dev-dependencies] mypy = "^0.982" From 8e85cd539f98039f981e659a5a54bcfb6a3462f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:14:04 +0000 Subject: [PATCH 11/27] Update redis requirement from >=3.5.3,<5.0.0 to >=3.5.3,<6.0.0 Updates the requirements on [redis](https://github.com/redis/redis-py) to permit the latest version. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/3.5.3...v5.0.2) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b9dbef8e..791be7c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ include=[ [tool.poetry.dependencies] python = ">=3.8,<4.0" -redis = ">=3.5.3,<5.0.0" +redis = ">=3.5.3,<6.0.0" pydantic = ">=1.10.2,<2.1.0" click = "^8.0.1" types-redis = ">=3.5.9,<5.0.0" From 54fc930a8d2fc38257c264adbcd46327168c48af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:14:08 +0000 Subject: [PATCH 12/27] Update black requirement from ^23.1 to ^24.2 Updates the requirements on [black](https://github.com/psf/black) to permit the latest version. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.1.0...24.2.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b9dbef8e..6bb38605 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ more-itertools = ">=8.14,<10.0" mypy = "^0.982" pytest = "^8.0.2" ipdb = "^0.13.9" -black = "^23.1" +black = "^24.2" isort = "^5.9.3" flake8 = "^5.0.4" bandit = "^1.7.4" From 575d55355201f892848b075b975eb983f89d6e8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 03:22:45 +0000 Subject: [PATCH 13/27] Update pydantic requirement from >=1.10.2,<2.1.0 to >=1.10.2,<2.7.0 Updates the requirements on [pydantic](https://github.com/pydantic/pydantic) to permit the latest version. - [Release notes](https://github.com/pydantic/pydantic/releases) - [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md) - [Commits](https://github.com/pydantic/pydantic/compare/v1.10.2...v2.6.3) --- updated-dependencies: - dependency-name: pydantic dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 92ca80d9..0cddb2d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ include=[ [tool.poetry.dependencies] python = ">=3.8,<4.0" redis = ">=3.5.3,<6.0.0" -pydantic = ">=1.10.2,<2.1.0" +pydantic = ">=1.10.2,<2.7.0" click = "^8.0.1" types-redis = ">=3.5.9,<5.0.0" python-ulid = "^1.0.3" From f73d99ce52e99e4814ab3f7974e5e789aaf28015 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:31:44 -0500 Subject: [PATCH 14/27] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0cddb2d8..07a1a435 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ include=[ [tool.poetry.dependencies] python = ">=3.8,<4.0" redis = ">=3.5.3,<6.0.0" -pydantic = ">=1.10.2,<2.7.0" +pydantic = ">=1.10.2,<2.6.0" click = "^8.0.1" types-redis = ">=3.5.9,<5.0.0" python-ulid = "^1.0.3" From 43c1261b499252b3022bc154d7f75f65f4f11ee7 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:33:31 -0500 Subject: [PATCH 15/27] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 07a1a435..a74aaf49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ include=[ [tool.poetry.dependencies] python = ">=3.8,<4.0" redis = ">=3.5.3,<6.0.0" -pydantic = ">=1.10.2,<2.6.0" +pydantic = ">=1.10.2,<2.5.0" click = "^8.0.1" types-redis = ">=3.5.9,<5.0.0" python-ulid = "^1.0.3" From 300e5e5b0b567ee5a96cbc7734120775f84b85a5 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Wed, 6 Mar 2024 22:49:10 -0500 Subject: [PATCH 16/27] Update command for compose to v2 --- Makefile | 6 +++--- docs/getting_started.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f478eade..9e41a736 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ clean: rm -rf dist rm -rf redis_om rm -rf tests_sync - docker-compose down + docker compose down .PHONY: dist @@ -65,7 +65,7 @@ format: $(INSTALL_STAMP) sync .PHONY: test test: $(INSTALL_STAMP) sync redis REDIS_OM_URL="$(REDIS_OM_URL)" $(POETRY) run pytest -n auto -vv ./tests/ ./tests_sync/ --cov-report term-missing --cov $(NAME) $(SYNC_NAME) - docker-compose down + docker compose down .PHONY: test_oss test_oss: $(INSTALL_STAMP) sync redis @@ -81,7 +81,7 @@ shell: $(INSTALL_STAMP) .PHONY: redis redis: - docker-compose up -d + docker compose up -d .PHONY: all all: lint format test diff --git a/docs/getting_started.md b/docs/getting_started.md index a2d6ff13..15fea449 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -603,7 +603,7 @@ andrew.key() With the model's Redis key, you can start `redis-cli` and inspect the data stored under that key. Here, we run `JSON.GET` command with `redis-cli` using the running "redis" container that this project's Docker Compose file defines: ``` -$ docker-compose exec -T redis redis-cli HGETALL mymodel.Customer:01FKGX1DFEV9Z2XKF59WQ6DC9r +$ docker compose exec -T redis redis-cli HGETALL mymodel.Customer:01FKGX1DFEV9Z2XKF59WQ6DC9r 1) "pk" 2) "01FKGX1DFEV9Z2XKF59WQ6DC9T" From 4372df808d0146aceda746632d125238b6edb35e Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Wed, 6 Mar 2024 22:51:07 -0500 Subject: [PATCH 17/27] Fix formatting issues with black --- aredis_om/__init__.py | 2 +- aredis_om/model/__init__.py | 2 +- aredis_om/model/model.py | 16 ++++++++++------ aredis_om/model/render_tree.py | 1 + 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/aredis_om/__init__.py b/aredis_om/__init__.py index 7aa699dd..813e3b04 100644 --- a/aredis_om/__init__.py +++ b/aredis_om/__init__.py @@ -8,11 +8,11 @@ FindQuery, HashModel, JsonModel, - VectorFieldOptions, KNNExpression, NotFoundError, QueryNotSupportedError, QuerySyntaxError, RedisModel, RedisModelError, + VectorFieldOptions, ) diff --git a/aredis_om/model/__init__.py b/aredis_om/model/__init__.py index b9ecf36f..fcdce89d 100644 --- a/aredis_om/model/__init__.py +++ b/aredis_om/model/__init__.py @@ -4,8 +4,8 @@ Field, HashModel, JsonModel, - VectorFieldOptions, KNNExpression, NotFoundError, RedisModel, + VectorFieldOptions, ) diff --git a/aredis_om/model/model.py b/aredis_om/model/model.py index a4c6b9e7..399b001c 100644 --- a/aredis_om/model/model.py +++ b/aredis_om/model/model.py @@ -1525,9 +1525,11 @@ async def all_pks(cls): # type: ignore # TODO: We need to decide how we want to handle the lack of # decode_responses=True... return ( - remove_prefix(key, key_prefix) - if isinstance(key, str) - else remove_prefix(key.decode(cls.Meta.encoding), key_prefix) + ( + remove_prefix(key, key_prefix) + if isinstance(key, str) + else remove_prefix(key.decode(cls.Meta.encoding), key_prefix) + ) async for key in cls.db().scan_iter(f"{key_prefix}*", _type="HASH") ) @@ -1698,9 +1700,11 @@ async def all_pks(cls): # type: ignore # TODO: We need to decide how we want to handle the lack of # decode_responses=True... return ( - remove_prefix(key, key_prefix) - if isinstance(key, str) - else remove_prefix(key.decode(cls.Meta.encoding), key_prefix) + ( + remove_prefix(key, key_prefix) + if isinstance(key, str) + else remove_prefix(key.decode(cls.Meta.encoding), key_prefix) + ) async for key in cls.db().scan_iter(f"{key_prefix}*", _type="ReJSON-RL") ) diff --git a/aredis_om/model/render_tree.py b/aredis_om/model/render_tree.py index 8ac5748d..106960bd 100644 --- a/aredis_om/model/render_tree.py +++ b/aredis_om/model/render_tree.py @@ -2,6 +2,7 @@ This code adapted from the library "pptree," Copyright (c) 2017 Clément Michard and released under the MIT license: https://github.com/clemtoy/pptree """ + import io From 39f4ac330e92c21681ea8e47afb863670f94b4a3 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Thu, 7 Mar 2024 00:41:18 -0500 Subject: [PATCH 18/27] Fix several typing issues --- aredis_om/model/query_resolver.py | 4 ++-- aredis_om/model/render_tree.py | 17 +++++++++-------- aredis_om/model/token_escaper.py | 6 +++--- aredis_om/util.py | 4 ++-- pyproject.toml | 3 +++ tox.ini | 2 +- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/aredis_om/model/query_resolver.py b/aredis_om/model/query_resolver.py index 3657970e..6af598ce 100644 --- a/aredis_om/model/query_resolver.py +++ b/aredis_om/model/query_resolver.py @@ -1,4 +1,4 @@ -from typing import List, Mapping +from typing import List, Mapping, Optional from aredis_om.model.model import Expression @@ -100,5 +100,5 @@ class QueryResolver: def __init__(self, *expressions: Expression): self.expressions = expressions - def resolve(self) -> str: + def resolve(self) -> Optional[str]: """Resolve expressions to a RediSearch query string.""" diff --git a/aredis_om/model/render_tree.py b/aredis_om/model/render_tree.py index 106960bd..0a1ce71a 100644 --- a/aredis_om/model/render_tree.py +++ b/aredis_om/model/render_tree.py @@ -4,17 +4,18 @@ """ import io +from typing import Any, Optional def render_tree( - current_node, - nameattr="name", - left_child="left", - right_child="right", - indent="", - last="updown", - buffer=None, -): + current_node: Any, + nameattr: str = "name", + left_child: str = "left", + right_child: str = "right", + indent: str = "", + last: str = "updown", + buffer: Optional[io.StringIO] = None, +) -> str: """Print a tree-like structure, `current_node`. This is a mostly-direct-copy of the print_tree() function from the ppbtree diff --git a/aredis_om/model/token_escaper.py b/aredis_om/model/token_escaper.py index 19fce96d..4c64a177 100644 --- a/aredis_om/model/token_escaper.py +++ b/aredis_om/model/token_escaper.py @@ -1,5 +1,5 @@ import re -from typing import Optional, Pattern +from typing import Match, Optional, Pattern class TokenEscaper: @@ -11,14 +11,14 @@ class TokenEscaper: # Source: https://redis.io/docs/stack/search/reference/escaping/#the-rules-of-text-field-tokenization DEFAULT_ESCAPED_CHARS = r"[,.<>{}\[\]\\\"\':;!@#$%^&*()\-+=~\/ ]" - def __init__(self, escape_chars_re: Optional[Pattern] = None): + def __init__(self, escape_chars_re: Optional[Pattern[str]] = None): if escape_chars_re: self.escaped_chars_re = escape_chars_re else: self.escaped_chars_re = re.compile(self.DEFAULT_ESCAPED_CHARS) def escape(self, value: str) -> str: - def escape_symbol(match): + def escape_symbol(match: Match[str]) -> str: value = match.group(0) return f"\\{value}" diff --git a/aredis_om/util.py b/aredis_om/util.py index d1feaeb1..268657e5 100644 --- a/aredis_om/util.py +++ b/aredis_om/util.py @@ -1,8 +1,8 @@ import inspect -def is_async_mode(): - async def f(): +def is_async_mode() -> bool: + async def f() -> None: """Unasync transforms async functions in sync functions""" return None diff --git a/pyproject.toml b/pyproject.toml index a74aaf49..437ab113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,3 +67,6 @@ migrate = "redis_om.model.cli.migrate:migrate" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + + + diff --git a/tox.ini b/tox.ini index 687666e3..3db89a94 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = true -envlist = py37, py38, py39, py310, py311 +envlist = py38, py39, py310, py311, py312 [testenv] whitelist_externals = poetry From e90b5105d4177ed80f98b07df2f5ea839a9145c9 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Thu, 7 Mar 2024 00:48:24 -0500 Subject: [PATCH 19/27] Bump tox to latest v3 release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 437ab113..f55ee93d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ pytest-xdist = "^3.1.0" unasync = "^0.5.0" pytest-asyncio = "^0.23.5" email-validator = "^2.0.0" -tox = "^3.26.0" +tox = "^3.28.0" tox-pyenv = "^1.1.0" [tool.poetry.scripts] From 735d6c3bd15163126af1c49ff7b2e7f299ad1b3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 05:50:38 +0000 Subject: [PATCH 20/27] Update tox requirement from ^3.26.0 to ^4.14.1 Updates the requirements on [tox](https://github.com/tox-dev/tox) to permit the latest version. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.26.0...4.14.1) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f55ee93d..bbe97482 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ pytest-xdist = "^3.1.0" unasync = "^0.5.0" pytest-asyncio = "^0.23.5" email-validator = "^2.0.0" -tox = "^3.28.0" +tox = "^4.14.1" tox-pyenv = "^1.1.0" [tool.poetry.scripts] From 1a9e5d5e02e225405b002f06ae96b7e2acc6a9ad Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Thu, 7 Mar 2024 00:55:34 -0500 Subject: [PATCH 21/27] Add py3.12 to pyproject.toml --- .github/dependabot.yml | 4 ++-- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 228461e6..bb54515c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,7 @@ updates: labels: - dependencies schedule: - interval: "daily" + interval: "weekly" # Maintain dependencies for Python - package-ecosystem: "pip" @@ -15,5 +15,5 @@ updates: labels: - dependencies schedule: - interval: "daily" + interval: "weekly" open-pull-requests-limit: 10 diff --git a/pyproject.toml b/pyproject.toml index f55ee93d..4aa681c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python', ] include=[ From 4a553011afeb408b5642aca67930a5282d942f66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 05:55:55 +0000 Subject: [PATCH 22/27] Bump codecov/codecov-action from 3 to 4 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68d52b81..40aa64ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,7 @@ jobs: make test poetry run coverage xml - name: Upload coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: file: ./coverage.xml flags: unit From 3d277cffa285ef3b584057e1b567e38736c0bfd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 05:55:58 +0000 Subject: [PATCH 23/27] Bump release-drafter/release-drafter from 5 to 6 Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 30a547bb..752c1db1 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 with: # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml config-name: release-drafter-config.yml From ea59eeab606d37f3e484b129fa0abe75f9982e04 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Fri, 22 Mar 2024 14:32:08 -0400 Subject: [PATCH 24/27] setting up setuptools when python version >= 3.12 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3625d5ac..07eaff76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ python-ulid = "^1.0.3" typing-extensions = "^4.4.0" hiredis = "^2.2.3" more-itertools = ">=8.14,<11.0" +setuptools = {version = "^69.2.0", markers = "python_version >= '3.12'"} [tool.poetry.dev-dependencies] mypy = "^0.982" From 539e7d4b7400f626243186feb8f09004f711885c Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 25 Mar 2024 09:27:17 -0400 Subject: [PATCH 25/27] moving escaped brace string interpolation into regular format methods to dodge PEP-701 tokenizer issue in unasync --- aredis_om/model/model.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aredis_om/model/model.py b/aredis_om/model/model.py index 399b001c..938a4c0a 100644 --- a/aredis_om/model/model.py +++ b/aredis_om/model/model.py @@ -630,20 +630,20 @@ def resolve_value( values: filter = filter(None, value.split(separator_char)) for value in values: value = escaper.escape(value) - result += f"@{field_name}:{{{value}}}" + result += "@{field_name}:{{{value}}}".format(field_name=field_name, value=value) else: value = escaper.escape(value) - result += f"@{field_name}:{{{value}}}" + result += "@{field_name}:{{{value}}}".format(field_name=field_name, value = value) elif op is Operators.NE: value = escaper.escape(value) - result += f"-(@{field_name}:{{{value}}})" + result += "-(@{field_name}:{{{value}}})".format(field_name=field_name, value=value) elif op is Operators.IN: expanded_value = cls.expand_tag_value(value) - result += f"(@{field_name}:{{{expanded_value}}})" + result += "(@{field_name}:{{{expanded_value}}})".format(field_name=field_name, expanded_value=expanded_value) elif op is Operators.NOT_IN: # TODO: Implement NOT_IN, test this... expanded_value = cls.expand_tag_value(value) - result += f"-(@{field_name}:{{{expanded_value}}})" + result += "-(@field_name):{{{expanded_value}}}".format(field_name=field_name, expanded_value=expanded_value) return result From 3bb6678b5c4498f9f185a20125c22496954f2e45 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Mon, 25 Mar 2024 09:33:49 -0400 Subject: [PATCH 26/27] fixing for linter --- aredis_om/model/model.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/aredis_om/model/model.py b/aredis_om/model/model.py index 938a4c0a..a90b3971 100644 --- a/aredis_om/model/model.py +++ b/aredis_om/model/model.py @@ -630,20 +630,30 @@ def resolve_value( values: filter = filter(None, value.split(separator_char)) for value in values: value = escaper.escape(value) - result += "@{field_name}:{{{value}}}".format(field_name=field_name, value=value) + result += "@{field_name}:{{{value}}}".format( + field_name=field_name, value=value + ) else: value = escaper.escape(value) - result += "@{field_name}:{{{value}}}".format(field_name=field_name, value = value) + result += "@{field_name}:{{{value}}}".format( + field_name=field_name, value=value + ) elif op is Operators.NE: value = escaper.escape(value) - result += "-(@{field_name}:{{{value}}})".format(field_name=field_name, value=value) + result += "-(@{field_name}:{{{value}}})".format( + field_name=field_name, value=value + ) elif op is Operators.IN: expanded_value = cls.expand_tag_value(value) - result += "(@{field_name}:{{{expanded_value}}})".format(field_name=field_name, expanded_value=expanded_value) + result += "(@{field_name}:{{{expanded_value}}})".format( + field_name=field_name, expanded_value=expanded_value + ) elif op is Operators.NOT_IN: # TODO: Implement NOT_IN, test this... expanded_value = cls.expand_tag_value(value) - result += "-(@field_name):{{{expanded_value}}}".format(field_name=field_name, expanded_value=expanded_value) + result += "-(@{field_name}):{{{expanded_value}}}".format( + field_name=field_name, expanded_value=expanded_value + ) return result From 1610602751ab6a0b12436ba3cc420de375266f1b Mon Sep 17 00:00:00 2001 From: slorello89 Date: Tue, 26 Mar 2024 11:21:11 -0400 Subject: [PATCH 27/27] updating version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 07eaff76..c92dae15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redis-om" -version = "0.2.1" +version = "0.2.2" description = "Object mappings, and more, for Redis." authors = ["Redis OSS "] maintainers = ["Redis OSS "]