Compare commits
No commits in common. "8d5d4d57cb021f35e5e026a34524c2015b7dbc2d" and "fde6c20b0cf786aa8f01a920e71d7612a9aaa25e" have entirely different histories.
8d5d4d57cb
...
fde6c20b0c
14 changed files with 27 additions and 57 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -76,7 +76,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
pyver: [ "3.8", "3.9", "3.10", "3.11", "pypy-3.8", "pypy-3.9" ]
|
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8", "pypy-3.9" ]
|
||||||
redisstack: [ "latest" ]
|
redisstack: [ "latest" ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
services:
|
services:
|
||||||
|
|
2
.github/workflows/spellcheck.yml
vendored
2
.github/workflows/spellcheck.yml
vendored
|
@ -8,7 +8,7 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Check Spelling
|
- name: Check Spelling
|
||||||
uses: rojopolis/spellcheck-github-actions@0.33.1
|
uses: rojopolis/spellcheck-github-actions@0.29.0
|
||||||
with:
|
with:
|
||||||
config_path: .github/spellcheck-settings.yml
|
config_path: .github/spellcheck-settings.yml
|
||||||
task_name: Markdown
|
task_name: Markdown
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -54,7 +54,7 @@ lint: $(INSTALL_STAMP) dist
|
||||||
$(POETRY) run isort --profile=black --lines-after-imports=2 ./tests/ $(NAME) $(SYNC_NAME)
|
$(POETRY) run isort --profile=black --lines-after-imports=2 ./tests/ $(NAME) $(SYNC_NAME)
|
||||||
$(POETRY) run black ./tests/ $(NAME)
|
$(POETRY) run black ./tests/ $(NAME)
|
||||||
$(POETRY) run flake8 --ignore=W503,E501,F401,E731 ./tests/ $(NAME) $(SYNC_NAME)
|
$(POETRY) run flake8 --ignore=W503,E501,F401,E731 ./tests/ $(NAME) $(SYNC_NAME)
|
||||||
$(POETRY) run mypy ./tests/ $(NAME) $(SYNC_NAME) --ignore-missing-imports --exclude migrate.py --exclude _compat\.py$
|
$(POETRY) run mypy ./tests/ $(NAME) $(SYNC_NAME) --ignore-missing-imports --exclude migrate.py
|
||||||
$(POETRY) run bandit -r $(NAME) $(SYNC_NAME) -s B608
|
$(POETRY) run bandit -r $(NAME) $(SYNC_NAME) -s B608
|
||||||
|
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
|
|
|
@ -386,8 +386,8 @@ Redis OM uses the [MIT license][license-url].
|
||||||
|
|
||||||
[version-svg]: https://img.shields.io/pypi/v/redis-om?style=flat-square
|
[version-svg]: https://img.shields.io/pypi/v/redis-om?style=flat-square
|
||||||
[package-url]: https://pypi.org/project/redis-om/
|
[package-url]: https://pypi.org/project/redis-om/
|
||||||
[ci-svg]: https://github.com/redis/redis-om-python/actions/workflows/ci.yml/badge.svg
|
[ci-svg]: https://img.shields.io/github/workflow/status/redis/redis-om-python/CI?style=flat-square
|
||||||
[ci-url]: https://github.com/redis/redis-om-python/actions/workflows/ci.yml
|
[ci-url]: https://github.com/redis/redis-om-python/actions/workflows/CI.yml
|
||||||
[license-image]: https://img.shields.io/badge/license-mit-green.svg?style=flat-square
|
[license-image]: https://img.shields.io/badge/license-mit-green.svg?style=flat-square
|
||||||
[license-url]: LICENSE
|
[license-url]: LICENSE
|
||||||
<!-- Links -->
|
<!-- Links -->
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
||||||
|
|
||||||
|
|
||||||
PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
|
|
||||||
|
|
||||||
if PYDANTIC_V2:
|
|
||||||
from pydantic.v1 import BaseModel, validator
|
|
||||||
from pydantic.v1.fields import FieldInfo, ModelField, Undefined, UndefinedType
|
|
||||||
from pydantic.v1.json import ENCODERS_BY_TYPE
|
|
||||||
from pydantic.v1.main import ModelMetaclass, validate_model
|
|
||||||
from pydantic.v1.typing import NoArgAnyCallable
|
|
||||||
from pydantic.v1.utils import Representation
|
|
||||||
else:
|
|
||||||
from pydantic import BaseModel, validator
|
|
||||||
from pydantic.fields import FieldInfo, ModelField, Undefined, UndefinedType
|
|
||||||
from pydantic.json import ENCODERS_BY_TYPE
|
|
||||||
from pydantic.main import ModelMetaclass, validate_model
|
|
||||||
from pydantic.typing import NoArgAnyCallable
|
|
||||||
from pydantic.utils import Representation
|
|
|
@ -31,7 +31,8 @@ from pathlib import PurePath
|
||||||
from types import GeneratorType
|
from types import GeneratorType
|
||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||||
|
|
||||||
from .._compat import ENCODERS_BY_TYPE, BaseModel
|
from pydantic import BaseModel
|
||||||
|
from pydantic.json import ENCODERS_BY_TYPE
|
||||||
|
|
||||||
|
|
||||||
SetIntStr = Set[Union[int, str]]
|
SetIntStr = Set[Union[int, str]]
|
||||||
|
|
|
@ -25,24 +25,18 @@ from typing import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from more_itertools import ichunked
|
from more_itertools import ichunked
|
||||||
|
from pydantic import BaseModel, validator
|
||||||
|
from pydantic.fields import FieldInfo as PydanticFieldInfo
|
||||||
|
from pydantic.fields import ModelField, Undefined, UndefinedType
|
||||||
|
from pydantic.main import ModelMetaclass, validate_model
|
||||||
|
from pydantic.typing import NoArgAnyCallable
|
||||||
|
from pydantic.utils import Representation
|
||||||
from redis.commands.json.path import Path
|
from redis.commands.json.path import Path
|
||||||
from redis.exceptions import ResponseError
|
from redis.exceptions import ResponseError
|
||||||
from typing_extensions import Protocol, get_args, get_origin
|
from typing_extensions import Protocol, get_args, get_origin
|
||||||
from ulid import ULID
|
from ulid import ULID
|
||||||
|
|
||||||
from .. import redis
|
from .. import redis
|
||||||
from .._compat import BaseModel
|
|
||||||
from .._compat import FieldInfo as PydanticFieldInfo
|
|
||||||
from .._compat import (
|
|
||||||
ModelField,
|
|
||||||
ModelMetaclass,
|
|
||||||
NoArgAnyCallable,
|
|
||||||
Representation,
|
|
||||||
Undefined,
|
|
||||||
UndefinedType,
|
|
||||||
validate_model,
|
|
||||||
validator,
|
|
||||||
)
|
|
||||||
from ..checks import has_redis_json, has_redisearch
|
from ..checks import has_redis_json, has_redisearch
|
||||||
from ..connections import get_redis_connection
|
from ..connections import get_redis_connection
|
||||||
from ..util import ASYNC_MODE
|
from ..util import ASYNC_MODE
|
||||||
|
|
|
@ -6,15 +6,15 @@ This tutorial will walk you through installing Redis OM, creating your first mod
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
Redis OM requires Python version 3.8 or above and a Redis instance to connect to.
|
Redis OM requires Python version 3.7 or above and a Redis instance to connect to.
|
||||||
|
|
||||||
## Python
|
## Python
|
||||||
|
|
||||||
Make sure you are running **Python version 3.8 or higher**:
|
Make sure you are running **Python version 3.7 or higher**:
|
||||||
|
|
||||||
```
|
```
|
||||||
python --version
|
python --version
|
||||||
Python 3.8.0
|
Python 3.7.0
|
||||||
```
|
```
|
||||||
|
|
||||||
If you don't have Python installed, you can download it from [Python.org](https://www.python.org/downloads/), use [pyenv](https://github.com/pyenv/pyenv), or install Python with your operating system's package manager.
|
If you don't have Python installed, you can download it from [Python.org](https://www.python.org/downloads/), use [pyenv](https://github.com/pyenv/pyenv), or install Python with your operating system's package manager.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "redis-om"
|
name = "redis-om"
|
||||||
version = "0.3.0"
|
version = "0.1.3"
|
||||||
description = "Object mappings, and more, for Redis."
|
description = "Object mappings, and more, for Redis."
|
||||||
authors = ["Redis OSS <oss@redis.com>"]
|
authors = ["Redis OSS <oss@redis.com>"]
|
||||||
maintainers = ["Redis OSS <oss@redis.com>"]
|
maintainers = ["Redis OSS <oss@redis.com>"]
|
||||||
|
@ -17,6 +17,8 @@ classifiers = [
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Topic :: Database",
|
"Topic :: Database",
|
||||||
'License :: OSI Approved :: BSD License',
|
'License :: OSI Approved :: BSD License',
|
||||||
|
'Programming Language :: Python :: 3.7',
|
||||||
|
'Programming Language :: Python :: 3.8',
|
||||||
'Programming Language :: Python :: 3.9',
|
'Programming Language :: Python :: 3.9',
|
||||||
'Programming Language :: Python :: 3.10',
|
'Programming Language :: Python :: 3.10',
|
||||||
'Programming Language :: Python :: 3.11',
|
'Programming Language :: Python :: 3.11',
|
||||||
|
@ -33,16 +35,15 @@ include=[
|
||||||
"Issue tracker" = "https://github.com/redis/redis-om-python/issues"
|
"Issue tracker" = "https://github.com/redis/redis-om-python/issues"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.9"
|
python = ">=3.7,<4.0"
|
||||||
redis = ">=3.5.3,<5.0.0"
|
redis = ">=3.5.3,<5.0.0"
|
||||||
pydantic = "^2.1.0"
|
pydantic = "^1.10.2"
|
||||||
click = "^8.0.1"
|
click = "^8.0.1"
|
||||||
types-redis = ">=3.5.9,<5.0.0"
|
types-redis = ">=3.5.9,<5.0.0"
|
||||||
python-ulid = "^2.0.0"
|
python-ulid = "^1.0.3"
|
||||||
typing-extensions = "^4.4.0"
|
typing-extensions = "^4.4.0"
|
||||||
hiredis = "^2.2.3"
|
hiredis = "^2.2.3"
|
||||||
more-itertools = ">=8.14,<10.0"
|
more-itertools = ">=8.14,<10.0"
|
||||||
setuptools = "^69.1.0"
|
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
mypy = "^0.982"
|
mypy = "^0.982"
|
||||||
|
@ -57,7 +58,7 @@ pytest-cov = "^4.0.0"
|
||||||
pytest-xdist = "^3.1.0"
|
pytest-xdist = "^3.1.0"
|
||||||
unasync = "^0.5.0"
|
unasync = "^0.5.0"
|
||||||
pytest-asyncio = "^0.20.3"
|
pytest-asyncio = "^0.20.3"
|
||||||
email-validator = "^2.0.0"
|
email-validator = "^1.3.0"
|
||||||
tox = "^3.26.0"
|
tox = "^3.26.0"
|
||||||
tox-pyenv = "^1.1.0"
|
tox-pyenv = "^1.1.0"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
from aredis_om._compat import PYDANTIC_V2
|
|
||||||
|
|
||||||
|
|
||||||
if PYDANTIC_V2:
|
|
||||||
from pydantic.v1 import EmailStr, ValidationError
|
|
||||||
else:
|
|
||||||
from pydantic import EmailStr, ValidationError
|
|
|
@ -10,6 +10,7 @@ from unittest import mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from aredis_om import (
|
from aredis_om import (
|
||||||
Field,
|
Field,
|
||||||
|
@ -23,7 +24,6 @@ from aredis_om import (
|
||||||
# We need to run this check as sync code (during tests) even in async mode
|
# We need to run this check as sync code (during tests) even in async mode
|
||||||
# because we call it in the top-level module scope.
|
# because we call it in the top-level module scope.
|
||||||
from redis_om import has_redisearch
|
from redis_om import has_redisearch
|
||||||
from tests._compat import ValidationError
|
|
||||||
|
|
||||||
from .conftest import py_test_mark_asyncio
|
from .conftest import py_test_mark_asyncio
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ from unittest import mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from aredis_om import (
|
from aredis_om import (
|
||||||
EmbeddedJsonModel,
|
EmbeddedJsonModel,
|
||||||
|
@ -24,7 +25,6 @@ from aredis_om import (
|
||||||
# We need to run this check as sync code (during tests) even in async mode
|
# We need to run this check as sync code (during tests) even in async mode
|
||||||
# because we call it in the top-level module scope.
|
# because we call it in the top-level module scope.
|
||||||
from redis_om import has_redis_json
|
from redis_om import has_redis_json
|
||||||
from tests._compat import ValidationError
|
|
||||||
|
|
||||||
from .conftest import py_test_mark_asyncio
|
from .conftest import py_test_mark_asyncio
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ from typing import Optional
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from aredis_om import HashModel, Migrator, NotFoundError, RedisModelError
|
from aredis_om import HashModel, Migrator, NotFoundError, RedisModelError
|
||||||
from tests._compat import ValidationError
|
|
||||||
|
|
||||||
from .conftest import py_test_mark_asyncio
|
from .conftest import py_test_mark_asyncio
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ from collections import namedtuple
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
from pydantic import EmailStr, ValidationError
|
||||||
|
|
||||||
from aredis_om import Field, HashModel, Migrator
|
from aredis_om import Field, HashModel, Migrator
|
||||||
from tests._compat import EmailStr, ValidationError
|
|
||||||
|
|
||||||
|
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue