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

Commit

Permalink
chore(release): release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKevJames committed Jun 8, 2021
1 parent 72e3f62 commit 061c2d2
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 33 deletions.
173 changes: 173 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<a name="2.0.0"></a>
## 2.0.0 (2021-06-08)

This is a breaking change! As of v1.1.8+, `aredis` has been hard-forked and
renamed to `yaaredis`. The `aredis` changelog is maintained below (see
`1.1.8`_) for posterity.

#### Breaking Changes

* rename package to `yaaredis` ([1ea13dd](1ea13dd))
* remove all deprecated features ([f4699a45](f4699a45)):
* deprecated methods have been removed
* deprecated options now raise Exceptions
* some ignorable deprecations have been replaced with error logs
* **pipeline:** auto-execute all remaining commands at end of `with` block ([814ca2bb](814ca2bb))
* **pool**: `ConnectionPool.get_connection()` is now a coroutine ([32969ed9](32969ed9))

#### Features

* **auth:** add support for Redis 5+ user&pass auth ([ca96dc6d](ca96dc6d))
* **client:** add option to init with client name ([f00c361a](f00c361a))
* **commands:** add support for SET's KEEPTTL option ([22c62f04](22c62f04))
* **pool:** implement blocking connection pool ([32969ed9](32969ed9)):
* this is available as the `BlockingConnectionPool` class; note that it does
not yet support cluster mode
* **scan:** add TYPE option ([0625dd8c](0625dd8c))

#### Bug Fixes

* **client:** prevent retry_on_timeout from affecting ConnectionError ([6626ebce](6626ebce)):
* ie. `retry_on_timeout` now only comes into play for timeouts
* **cluster:** avoid runtime error on disconnected client ([740ea19f](740ea19f)):
* prevents a race condition within `yaaredis` from raising occasional errors
* **connection:**
* always reduce count on force disconnect ([b49b3c65](b49b3c65)):
* fixes some instances of "connection leaking"
* expose initial `connect()` error message ([2073f576](2073f576)):
* by forwarding this message, this should make some debugging a bit easier
* **pubsub:** reraise CancelledError during _execute ([90dd2641](90dd2641)):
* prevents an issue where a cancelled coroutine may continue indefinitely

#### Performance

* **cluster:** support MGET and MSET for hashed keys ([08180835](08180835)):
* see the following redis documentation for more info:
https://redis.io/topics/cluster-tutorial#redis-cluster-data-sharding
you'll need to make use of "hash slots" to get the full benefit of this
feature

#### Internal

* convert build system to poetry ([b86d695](b86d695)):
* note that this should not affect end-users, only yaaredis developers
* publish pypi wheels from CI ([05c2265](05c2265)):
* we should now have wheels for various versions of Python for all releases
* we currently support manylinux wheels for all compatible Python versions

<a name="1.1.8"></a>
## 1.1.8
* Fixbug: connection is disconnected before idel check, valueError will be raised if a connection(not exist) is removed from connection list
* Fixbug: abstract compat.py to handle import problem of asyncio.future
* Fixbug: When cancelling a task, CancelledError exception is not propagated to client
* Fixbug: XREAD command should accept 0 as a block argument
* Fixbug: In redis cluster mode, XREAD command does not function properly
* Fixbug: slave connection params when there are no slaves

<a name="1.1.7"></a>
## 1.1.7
* Fixbug: ModuleNotFoundError raised when install aredis 1.1.6 with Python3.6

<a name="1.1.6"></a>
## 1.1.6
* Fixbug: parsing stream messgae with empty payload will cause error(#116)
* Fixbug: Let ClusterConnectionPool handle skip_full_coverage_check (#118)
* New: threading local issue in coroutine, use contextvars instead of threading local in case of the safety of thread local mechanism being broken by coroutine (#120)
* New: support Python 3.8

<a name="1.1.5"></a>
## 1.1.5
* new: Dev conn pool max idle time (#111) release connection if max-idle-time exceeded
* update: discard travis-CI
* Fix bug: new stream id used for test_streams

<a name="1.1.4"></a>
## 1.1.4
* fix bug: fix cluster port parsing for redis 4+(node info)
* fix bug: wrong parse method of scan_iter in cluster mode
* fix bug: When using "zrange" with "desc=True" parameter, it returns a coroutine without "await"
* fix bug: do not use stream_timeout in the PubSubWorkerThread
* opt: add socket_keepalive options
* new: add ssl param in get_redis_link to support ssl mode
* new: add ssl_context to StrictRedis constructor and make it higher priority than ssl parameter

<a name="1.1.3"></a>
## 1.1.3
* allow use of zadd options for zadd in sorted sets
* fix bug: use inspect.isawaitable instead of typing.Awaitable to judge if an object is awaitable
* fix bug: implicitly disconnection on cancelled error (#84)
* new: add support for `streams`(including commands not officially released, see `streams <http://aredis.readthedocs.io/en/latest/streams.html>`_ )

<a name="1.1.2"></a>
## 1.1.2
* fix bug: redis command encoding bug
* optimization: sync change on acquring lock from redis-py
* fix bug: decrement connection count on connection disconnected
* fix bug: optimize code proceed single node slots
* fix bug: initiation error of aws cluster client caused by not appropiate function list used
* fix bug: use `ssl_context` instead of ssl_keyfile,ssl_certfile,ssl_cert_reqs,ssl_ca_certs in intialization of connection_pool

<a name="1.1.1"></a>
## 1.1.1
* fix bug: connection with unread response being released to connection pool will lead to parse error, now this kind of connection will be destructed directly. `related issue <https://github.com/NoneGG/aredis/issues/52>`_
* fix bug: remove Connection.can_read check which may lead to block in awaiting pubsub message. Connection.can_read api will be deprecated in next release. `related issue <https://github.com/NoneGG/aredis/issues/56>`_
* add c extension to speedup crc16, which will speedup cluster slot hashing
* add error handling for asyncio.futures.Cancelled error, which may cause error in response parsing.
* sync optimization of client list made by swilly22 from redis-py
* add support for distributed lock using redis cluster

<a name="1.1.0"></a>
## 1.1.0
* sync optimization of scripting from redis-py made by `bgreenberg <https://github.com/bgreenberg-eb>`_ `related pull request <https://github.com/andymccurdy/redis-py/pull/867>`_
* sync bug fixed of `geopos` from redis-py made by `categulario <https://github.com/categulario>`_ `related pull request <https://github.com/andymccurdy/redis-py/pull/888>`_
* fix bug which makes pipeline callback function not executed
* fix error caused by byte decode issues in sentinel
* add basic transaction support for single node in cluster
* fix bug of get_random_connection reported by myrfy001

<a name="1.0.9"></a>
## 1.0.9
* fix bug of pubsub, in some env AssertionError is raised because connection is used again after reader stream being fed eof
* add reponse decoding related options(`encoding` & `decode_responses`), make client easier to use
* add support for command `cluster forget`
* add support for command option `spop count`

<a name="1.0.8"></a>
## 1.0.8
* fix initialization bug of redis cluster client
* add example to explain how to use `client reply on | off | skip`

<a name="1.0.7"></a>
## 1.0.7
* introduce loop argument to aredis
* add support for command `cluster slots`
* add support for redis cluster

<a name="1.0.6"></a>
## 1.0.6
* bitfield set/get/incrby/overflow supported
* new command `hstrlen` supported
* new command `unlink` supported
* new command `touch` supported

<a name="1.0.5"></a>
## 1.0.5
* fix bug in setup.py when using pip to install aredis

<a name="1.0.4"></a>
## 1.0.4
* add support for command `pubsub channel`, `pubsub numpat` and `pubsub numsub`
* add support for command `client pause`
* reconsitution of commands to make develop easier(which is transparent to user)

<a name="1.0.2"></a>
## 1.0.2
* add support for cache (Cache and HerdCache class)
* fix bug of `PubSub.run_in_thread`

<a name="1.0.1"></a>
## 1.0.1
* add scan_iter, sscan_iter, hscan_iter, zscan_iter and corresponding unit tests
* fix bug of `PubSub.run_in_thread`
* add more examples
* change `Script.register` to `Script.execute`
69 changes: 37 additions & 32 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
talkiq/yaaredis
===============

|circleci|
|circleci| |pypi-version| |python-versions|

.. |circleci| image:: https://img.shields.io/circleci/project/github/talkiq/yaaredis/master.svg?style=flat-square
:alt: CircleCI Test Status
:target: https://circleci.com/gh/talkiq/yaaredis/tree/master

.. |pypi-version| image:: https://img.shields.io/pypi/v/yaaredis.svg?style=flat-square&label=PyPI
:alt: Latest PyPI Release
:target: https://pypi.org/project/yaaredis/

.. |python-versions| image:: https://img.shields.io/pypi/pyversions/yaaredis.svg?style=flat-square&label=Python%20Versions
:alt: Compatible Python Versions
:target: https://pypi.org/project/yaaredis/

``yaaredis`` (Yet Another Async Redis (client)) is a fork of
`aredis <https://github.com/NoneGG/aredis>`_, which itself was ported from
`redis-py <https://github.com/andymccurdy/redis-py>`_. ``yaaredis`` provides an
efficient and user-friendly async redis client with support for Redis Server,
Cluster, and Sentinels.

To get more information please read the `full document`_ managed by the
upstream ``aredis`` repo.

.. _full document: http://aredis.readthedocs.io/en/latest/
To get more information please read the `full documentation`_ managed by the
upstream ``aredis`` repo. We are working on hosting our own as the projects
diverge -- stay tuned!

Installation
------------
Expand All @@ -25,28 +32,29 @@ Installation

.. code-block:: console
python3 -m pip install yaaredis[hiredis]
python3 -m pip install yaaredis
or from source:

.. code-block:: console
python3 -m pip install .
Getting started
---------------
Note that ``yaaredis`` also supports using ``hiredis`` as a drop-in performance
improvements. You can either install ``hiredis`` separately or make use of the
PyPI extra to make use of this functionality:

`More examples`_

.. _More examples: https://github.com/talkiq/yaaredis/tree/master/examples
.. code-block:: console
Tip: since python 3.8 you can use asyncio REPL:
python3 -m pip install yaaredis[hiredis]
.. code-block:: bash
Getting started
---------------

$ python3 -m asyncio
We have `various examples`_ in this repo which you may find useful. A few more
specific cases are listed below.

single node client
Single Node Client
^^^^^^^^^^^^^^^^^^

.. code-block:: python
Expand All @@ -68,10 +76,9 @@ single node client
await asyncio.sleep(1)
assert not await client.exists('foo')
loop = asyncio.get_event_loop()
loop.run_until_complete(example())
asyncio.run(example())
cluster client
Cluster Client
^^^^^^^^^^^^^^

.. code-block:: python
Expand All @@ -89,29 +96,27 @@ cluster client
await client.rpoplpush('a', 'b')
assert await client.rpop('b') == b'1'
loop = asyncio.get_event_loop()
loop.run_until_complete(example())
# {(10923, 16383): [{'host': b'172.17.0.2', 'node_id': b'332f41962b33fa44bbc5e88f205e71276a9d64f4', 'server_type': 'master', 'port': 7002},
# {'host': b'172.17.0.2', 'node_id': b'c02deb8726cdd412d956f0b9464a88812ef34f03', 'server_type': 'slave', 'port': 7005}],
# (5461, 10922): [{'host': b'172.17.0.2', 'node_id': b'3d1b020fc46bf7cb2ffc36e10e7d7befca7c5533', 'server_type': 'master', 'port': 7001},
# {'host': b'172.17.0.2', 'node_id': b'aac4799b65ff35d8dd2ad152a5515d15c0dc8ab7', 'server_type': 'slave', 'port': 7004}],
# (0, 5460): [{'host': b'172.17.0.2', 'node_id': b'0932215036dc0d908cf662fdfca4d3614f221b01', 'server_type': 'master', 'port': 7000},
# {'host': b'172.17.0.2', 'node_id': b'f6603ab4cb77e672de23a6361ec165f3a1a2bb42', 'server_type': 'slave', 'port': 7003}]}
asyncio.run(example())
# {(10923, 16383): [{'host': b'172.17.0.2', 'node_id': b'332f41962b33fa44bbc5e88f205e71276a9d64f4', 'server_type': 'master', 'port': 7002},
# {'host': b'172.17.0.2', 'node_id': b'c02deb8726cdd412d956f0b9464a88812ef34f03', 'server_type': 'slave', 'port': 7005}],
# (5461, 10922): [{'host': b'172.17.0.2', 'node_id': b'3d1b020fc46bf7cb2ffc36e10e7d7befca7c5533', 'server_type': 'master', 'port': 7001},
# {'host': b'172.17.0.2', 'node_id': b'aac4799b65ff35d8dd2ad152a5515d15c0dc8ab7', 'server_type': 'slave', 'port': 7004}],
# (0, 5460): [{'host': b'172.17.0.2', 'node_id': b'0932215036dc0d908cf662fdfca4d3614f221b01', 'server_type': 'master', 'port': 7000},
# {'host': b'172.17.0.2', 'node_id': b'f6603ab4cb77e672de23a6361ec165f3a1a2bb42', 'server_type': 'slave', 'port': 7003}]}
Benchmark
---------

Please run test scripts in the ``benchmarks`` directory to confirm the
benchmarks.

For a benchmark in the original yaaredis author's environment please see:
`benchmark`_.

.. _benchmark: http://aredis.readthedocs.io/en/latest/benchmark.html
benchmarks. For a benchmark in the original yaaredis author's environment
please see: `benchmark`_.

Contributing
------------

Developer? See our `guide`_ on how you can contribute.

.. _benchmark: http://aredis.readthedocs.io/en/latest/benchmark.html
.. _full documentation: http://aredis.readthedocs.io/en/latest/
.. _guide: https://github.com/talkiq/yaaredis/blob/master/.github/CONTRIBUTING.rst
.. _various examples: https://github.com/talkiq/yaaredis/tree/master/examples
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "yaaredis"
version = "2.0.0-alpha.3"
version = "2.0.0"
description = "Python async client for Redis key-value store"
readme = "README.rst"

Expand Down

0 comments on commit 061c2d2

Please sign in to comment.