Drop Protocol class to support Python 3.7

This commit is contained in:
Andrew Brookins 2021-11-08 15:41:10 -08:00
parent 3ee2252539
commit 984c11679a
3 changed files with 3 additions and 26 deletions

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "redis-om" name = "redis-om"
version = "0.0.7" version = "0.0.8"
description = "A high-level library containing useful Redis abstractions and tools, like an ORM and leaderboard." description = "A high-level library containing useful Redis abstractions and tools, like an ORM and leaderboard."
authors = ["Andrew Brookins <andrew.brookins@redis.com>"] authors = ["Andrew Brookins <andrew.brookins@redis.com>"]
maintainers = ["Andrew Brookins <andrew.brookins@redis.com>"] maintainers = ["Andrew Brookins <andrew.brookins@redis.com>"]

View file

@ -136,29 +136,6 @@ def decode_redis_value(
return obj.decode(encoding) return obj.decode(encoding)
class ExpressionProtocol(Protocol):
op: Operators
left: ExpressionOrModelField
right: ExpressionOrModelField
def __invert__(self) -> "Expression":
pass
def __and__(self, other: ExpressionOrModelField):
pass
def __or__(self, other: ExpressionOrModelField):
pass
@property
def name(self) -> str:
raise NotImplementedError
@property
def tree(self) -> str:
raise NotImplementedError
@dataclasses.dataclass @dataclasses.dataclass
class NegatedExpression: class NegatedExpression:
"""A negated Expression object. """A negated Expression object.
@ -814,7 +791,7 @@ class FindQuery:
return query.execute()[0] return query.execute()[0]
class PrimaryKeyCreator(Protocol): class PrimaryKeyCreator(abc.ABC):
def create_pk(self, *args, **kwargs) -> str: def create_pk(self, *args, **kwargs) -> str:
"""Create a new primary key""" """Create a new primary key"""

View file

@ -1,6 +1,6 @@
[tox] [tox]
skipsdist = true skipsdist = true
envlist = py38, py39, py310 envlist = py37, py38, py39, py310
[testenv] [testenv]
whitelist_externals = poetry whitelist_externals = poetry