Skip to content

Commit

Permalink
Merge pull request #4 from tzickel/py39
Browse files Browse the repository at this point in the history
Py39 testing support
  • Loading branch information
tzickel authored Oct 5, 2020
2 parents 3276c46 + 356583f commit 12c63bb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
8 changes: 3 additions & 5 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@ ARG BASE_IMAGE=quay.io/pypa/manylinux2014_x86_64
FROM $BASE_IMAGE

ARG REDIS5_VERSION=5.0.9
ARG REDIS6_VERSION=5.0.8
ARG REDIS6_VERSION=6.0.8
RUN cd /tmp && mkdir redis5 && curl -s https://download.redis.io/releases/redis-${REDIS5_VERSION}.tar.gz | tar -xvzo -C redis5 --strip-components=1 > /dev/null 2>&1 && cd redis5 && make > /dev/null 2>&1
RUN cd /tmp && mkdir redis6 && curl -s https://download.redis.io/releases/redis-${REDIS6_VERSION}.tar.gz | tar -xvzo -C redis6 --strip-components=1 > /dev/null 2>&1 && cd redis6 && make > /dev/null 2>&1

ARG PYPY3_VERSION=7.3.2
RUN cd /opt/python && mkdir pypy3 && curl -s -L https://downloads.python.org/pypy/pypy3.6-v${PYPY3_VERSION}-linux64.tar.bz2 | tar -xvjo -C pypy3 --strip-components=1 > /dev/null 2>&1

#WORKDIR /opt

#ADD https://api.github.com/repos/tzickel/justredis/git/refs/heads/master version.json

#RUN git clone https://github.com/tzickel/justredis

WORKDIR /opt/justredis

ADD . .

RUN /opt/python/cp38-cp38/bin/pip install -U tox pip setuptools wheel > /dev/null 2>&1
RUN REDIS_6_PATH=/tmp/redis6/src REDIS_5_PATH=/tmp/redis5/src PATH=$PATH:/opt/python/cp38-cp38/bin:/opt/python/cp37-cp37m/bin:/opt/python/cp36-cp36m/bin:/opt/python/cp35-cp35m/bin:/opt/python/pypy3/bin /opt/python/cp38-cp38/bin/tox
RUN /opt/python/cp38-cp38/bin/python setup.py sdist bdist_wheel
RUN REDIS_6_PATH=/tmp/redis6/src REDIS_5_PATH=/tmp/redis5/src PATH=$PATH:/opt/python/cp39-cp39/bin:/opt/python/cp38-cp38/bin:/opt/python/cp37-cp37m/bin:/opt/python/cp36-cp36m/bin:/opt/python/cp35-cp35m/bin:/opt/python/pypy3/bin /opt/python/cp38-cp38/bin/tox
RUN /opt/python/cp38-cp38/bin/python setup.py bdist_wheel
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ A Redis client for Python supporting many Redis features and Python synchronous
- Per context and command properties (database #, decoding, RESP3 attributes)
- Asynchronous I/O support with the same exact API (but with the await keyword), targeting asyncio, trio and curio (using [AnyIO](https://github.com/agronholm/anyio) which needs to be installed as well if you want async I/O)
- Modular API allowing for easy support for multiple synchronous and asynchronous event loops and disabling of unneeded features
- CI Testing for CPython 3.5, 3.6, 3.7, 3.8, 3.9 and PyPy3 with Redis 5 and Redis 6
- No legacy support for old language features

## Redis features support table
Expand All @@ -32,16 +33,15 @@ Getting it out of alpha:
- [ ] Is the modify() API flexiable enough ?
- [ ] Is it easy to extend the module ?
- [ ] Should we add helper functions for SCAN iterators and other API ?
- [ ] Asynchronous support
- [ ] Automate code convertion between sync and async
- [ ] Make sure cancelations are handled properly
- [ ] Resolving some of the TODO in code

General:
- More features in the support table
- Better test coverage
- Resolve all TODO in code
- Move documentation to topics + docstrings
- Automate code convertion between sync and async
- More CI checks such as flake8, pylint, etc..

## Not on roadmap (for now?)

Expand Down
3 changes: 3 additions & 0 deletions justredis/nonsync/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ def __init__(self, pool_factory=ClusterConnectionPool, custom_command_class=None
"""
Currently documented in README.md
"""
self._connection_pool = None
if pool_factory == "pool":
pool_factory = ConnectionPool
elif pool_factory in ("auto", "cluster"):
pool_factory = ClusterConnectionPool
if not hasattr(pool_factory, "__call__"):
raise AttributeError("A valid pool_factory is required, if you want to set address, use .from_url() or address=(host, port)")
super(Redis, self).__init__(pool_factory(**kwargs), custom_command_class=custom_command_class)

async def aclose(self):
Expand Down
3 changes: 3 additions & 0 deletions justredis/sync/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ def __init__(self, pool_factory=ClusterConnectionPool, custom_command_class=None
"""
Currently documented in README.md
"""
self._connection_pool = None
if pool_factory == "pool":
pool_factory = ConnectionPool
elif pool_factory in ("auto", "cluster"):
pool_factory = ClusterConnectionPool
if not hasattr(pool_factory, "__call__"):
raise AttributeError("A valid pool_factory is required, if you want to set address, use .from_url() or address=(host, port)")
super(Redis, self).__init__(pool_factory(**kwargs), custom_command_class=custom_command_class)

def __del__(self):
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[tox]
envlist = clean,py{35,36,37,38,py3}
envlist = clean,py{35,36,37,38,39,py3}
#isolated_build = true
skip_missing_interpreters = true

[testenv]
deps =
pytest
pytest-cov
py{36,37,38,py3}: anyio[trio,curio]
py{36,37,38,39,py3}: anyio[trio,curio]
commands =
py{35,36,37,38,py3}: pytest --cov={toxinidir}/justredis --cov={toxinidir}/tests --cov-append --cov-report=term-missing {posargs}
py{35,36,37,38,39,py3}: pytest --cov={toxinidir}/justredis --cov={toxinidir}/tests --cov-append --cov-report=term-missing {posargs}
passenv =
REDIS_6_PATH
REDIS_5_PATH
Expand Down

0 comments on commit 12c63bb

Please # to comment.