Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Port redis-py impl and tests to aioredis.
Browse files Browse the repository at this point in the history
  • Loading branch information
seandstewart committed Mar 15, 2021
1 parent 53d8103 commit c26a671
Show file tree
Hide file tree
Showing 102 changed files with 13,128 additions and 16,631 deletions.
105 changes: 0 additions & 105 deletions .travis.yml

This file was deleted.

16 changes: 6 additions & 10 deletions Makefile
@@ -1,8 +1,8 @@
PYTHON ?= python3
PYTHON ?= python3
PYTEST ?= pytest
MYPY ?= mypy

REDIS_TAGS ?= 2.6.17 2.8.22 3.0.7 3.2.13 4.0.14 5.0.9
REDIS_TAGS ?= 2.6.17 2.8.22 3.0.7 3.2.13 4.0.14 5.0.9 6.0.10

ARCHIVE_URL = https://github.com/antirez/redis/archive
INSTALL_DIR ?= build
Expand Down Expand Up @@ -31,7 +31,7 @@ mypy:
$(MYPY) aioredis --ignore-missing-imports

test:
$(PYTEST)
$(PYTEST) --timeout=60

cov coverage:
$(PYTEST) --cov
Expand Down Expand Up @@ -63,11 +63,7 @@ aioredis.egg-info:
pip install -Ue .


ifdef TRAVIS
examples: .start-redis $(EXAMPLES)
else
examples: $(EXAMPLES)
endif

$(EXAMPLES):
@export REDIS_VERSION="$(redis-cli INFO SERVER | sed -n 2p)"
Expand All @@ -88,11 +84,11 @@ certificate:

ci-test: $(REDIS_TARGETS)
$(PYTEST) \
--cov --cov-report=xml -vvvs\
$(foreach T,$(REDIS_TARGETS),--redis-server=$T)
--timeout=60 --cov --cov-report=xml -vvvs\
$(foreach $(REDIS_TARGETS))

ci-test-%: $(INSTALL_DIR)/%/redis-server
$(PYTEST) --cov --redis-server=$<
$(PYTEST) --cov

ci-build-redis: $(REDIS_TARGETS)

Expand Down
102 changes: 50 additions & 52 deletions aioredis/__init__.py
@@ -1,61 +1,59 @@
from .commands import GeoMember, GeoPoint, Redis, create_redis, create_redis_pool
from .connection import RedisConnection, create_connection
from .errors import (
AuthError,
ChannelClosedError,
ConnectionClosedError,
ConnectionForcedCloseError,
MasterNotFoundError,
MasterReplyError,
MaxClientsError,
MultiExecError,
PipelineError,
PoolClosedError,
ProtocolError,
from aioredis.client import Redis, StrictRedis
from aioredis.connection import (
BlockingConnectionPool,
Connection,
ConnectionPool,
SSLConnection,
UnixDomainSocketConnection,
)
from aioredis.exceptions import (
AuthenticationError,
AuthenticationWrongNumberOfArgsError,
BusyLoadingError,
ChildDeadlockedError,
ConnectionError,
DataError,
InvalidResponse,
PubSubError,
ReadOnlyError,
RedisError,
ReplyError,
SlaveNotFoundError,
SlaveReplyError,
WatchVariableError,
ResponseError,
TimeoutError,
WatchError,
)
from .pool import ConnectionsPool, create_pool
from .pubsub import Channel
from .sentinel import RedisSentinel, create_sentinel
from aioredis.utils import from_url


def int_or_str(value):
try:
return int(value)
except ValueError:
return value

__version__ = "1.3.1"

__version__ = "3.5.3"
VERSION = tuple(map(int_or_str, __version__.split(".")))

__all__ = [
# Factories
"create_connection",
"create_pool",
"create_redis",
"create_redis_pool",
"create_sentinel",
# Classes
"RedisConnection",
"ConnectionsPool",
"AuthenticationError",
"AuthenticationWrongNumberOfArgsError",
"BlockingConnectionPool",
"BusyLoadingError",
"ChildDeadlockedError",
"Connection",
"ConnectionError",
"ConnectionPool",
"DataError",
"from_url",
"InvalidResponse",
"PubSubError",
"ReadOnlyError",
"Redis",
"GeoPoint",
"GeoMember",
"Channel",
"RedisSentinel",
# Errors
"RedisError",
"ReplyError",
"MaxClientsError",
"AuthError",
"ProtocolError",
"PipelineError",
"MultiExecError",
"WatchVariableError",
"ConnectionClosedError",
"ConnectionForcedCloseError",
"PoolClosedError",
"ChannelClosedError",
"MasterNotFoundError",
"SlaveNotFoundError",
"ReadOnlyError",
"MasterReplyError",
"SlaveReplyError",
"ResponseError",
"SSLConnection",
"StrictRedis",
"TimeoutError",
"UnixDomainSocketConnection",
"WatchError",
]

0 comments on commit c26a671

Please sign in to comment.