diff --git a/account-defaults-redis.patch b/account-defaults-redis.patch deleted file mode 100644 index beabd09..0000000 --- a/account-defaults-redis.patch +++ /dev/null @@ -1,87 +0,0 @@ -From fea5d60c4426ec31a0e309a2efb2be62f6b2a412 Mon Sep 17 00:00:00 2001 -From: "Chayim I. Kirshen" -Date: Mon, 28 Jun 2021 16:34:00 +0300 -Subject: [PATCH 1/3] changing unit tests to account for defaults in redis - flags - -Some versions of redis (validated against 6.2.4) set extra flags, making the tests fail. - -Modified the tests to validate the specific flags pertaining to the test case are in place. - -Similarly with acl_list, as other tests validate the specifics of acl_setuser, I changed it to validate against the acl list. - -Finally, while here, I added python 3.9 to tox ---- - tests/test_commands.py | 37 ++++++++++++++++++------------------- - 1 file changed, 18 insertions(+), 19 deletions(-) - ---- a/tests/test_commands.py -+++ b/tests/test_commands.py -@@ -105,25 +105,24 @@ class TestRedisCommands(object): - - # test enabled=False - assert r.acl_setuser(username, enabled=False, reset=True) -- assert r.acl_getuser(username) == { -- 'categories': ['-@all'], -- 'commands': [], -- 'enabled': False, -- 'flags': ['off'], -- 'keys': [], -- 'passwords': [], -- } -+ acl = r.acl_getuser(username) -+ assert acl['categories'] == ['-@all'] -+ assert acl['commands'] == [] -+ assert acl['keys'] == [] -+ assert acl['passwords'] == [] -+ assert 'off' in acl['flags'] -+ assert acl['enabled'] is False - - # test nopass=True - assert r.acl_setuser(username, enabled=True, reset=True, nopass=True) -- assert r.acl_getuser(username) == { -- 'categories': ['-@all'], -- 'commands': [], -- 'enabled': True, -- 'flags': ['on', 'nopass'], -- 'keys': [], -- 'passwords': [], -- } -+ acl = r.acl_getuser(username) -+ assert acl['categories'] == ['-@all'] -+ assert acl['commands'] == [] -+ assert acl['keys'] == [] -+ assert acl['passwords'] == [] -+ assert 'on' in acl['flags'] -+ assert 'nopass' in acl['flags'] -+ assert acl['enabled'] is True - - # test all args - assert r.acl_setuser(username, enabled=True, reset=True, -@@ -135,7 +134,7 @@ class TestRedisCommands(object): - assert set(acl['categories']) == set(['-@all', '+@set', '+@hash']) - assert set(acl['commands']) == set(['+get', '+mget', '-hset']) - assert acl['enabled'] is True -- assert acl['flags'] == ['on'] -+ assert 'on' in acl['flags'] - assert set(acl['keys']) == set([b'cache:*', b'objects:*']) - assert len(acl['passwords']) == 2 - -@@ -154,7 +153,7 @@ class TestRedisCommands(object): - assert set(acl['categories']) == set(['-@all', '+@set', '+@hash']) - assert set(acl['commands']) == set(['+get', '+mget']) - assert acl['enabled'] is True -- assert acl['flags'] == ['on'] -+ assert 'on' in acl['flags'] - assert set(acl['keys']) == set([b'cache:*', b'objects:*']) - assert len(acl['passwords']) == 2 - -@@ -193,7 +192,7 @@ class TestRedisCommands(object): - - assert r.acl_setuser(username, enabled=False, reset=True) - users = r.acl_list() -- assert 'user %s off -@all' % username in users -+ assert len(users) == 2 - - @skip_if_server_version_lt(REDIS_6_VERSION) - def test_acl_setuser_categories_without_prefix_fails(self, r, request): diff --git a/python-redis.changes b/python-redis.changes index a9ea304..aeec078 100644 --- a/python-redis.changes +++ b/python-redis.changes @@ -1,3 +1,346 @@ +------------------------------------------------------------------- +Sat Jun 11 11:03:12 UTC 2022 - Ben Greiner + +- Update to version 4.3.3 + * Fix Lock crash, and versioning 4.3.3 (#2210) + * Async cluster: improve docs (#2208) +- Release 4.3.2 + * SHUTDOWN - add support for the new NOW, FORCE and ABORT modifiers (#2150) + * Adding pipeline support for async cluster (#2199) + * Support CF.MEXISTS + Clean bf/commands.py (#2184) + * Extending query_params for FT.PROFILE (#2198) + * Implementing ClusterPipeline Lock (#2190) + * Set default response_callbacks to redis.asyncio.cluster.ClusterNode (#2201) + * Add default None for maxlen at xtrim command (#2188) + * Async cluster: add/update typing (#2195) + * Changed list type to single element type (#2203) + * Made sync lock consistent and added types to it (#2137) + * Async cluster: optimisations (#2205) + * Fix typos in README (#2206) + * Fix modules links to https://redis.io/commands/ (#2185) + +------------------------------------------------------------------- +Tue May 10 18:19:07 UTC 2022 - Ben Greiner + +- Update to version 4.3.1 + * Allow negative `retries` for `Retry` class to retry forever + * Add `items` parameter to `hset` signature + * Create codeql-analysis.yml (#1988). Thanks @chayim + * Add limited support for Lua scripting with RedisCluster + * Implement `.lock()` method on RedisCluster + * Fix cursor returned by SCAN for RedisCluster & change default + target to PRIMARIES + * Fix scan_iter for RedisCluster + * Remove verbose logging when initializing ClusterPubSub, + ClusterPipeline or RedisCluster + * Fix broken connection writer lock-up for asyncio (#2065) + * Fix auth bug when provided with no username (#2086) +- Release 4.1.3 + * Fix flushdb and flushall (#1926) + * Add redis5 and redis4 dockers (#1871) + * Change json.clear test multi to be up to date with redisjson + (#1922) + * Fixing volume for unstable_cluster docker (#1914) + * Update changes file with changes since 4.0.0-beta2 (#1915) +- Release 4.1.2 + * Invalid OCSP certificates should raise ConnectionError on + failed validation (#1907) + * Added retry mechanism on socket timeouts when connecting to + the server (#1895) + * LMOVE, BLMOVE return incorrect responses (#1906) + * Fixing AttributeError in UnixDomainSocketConnection (#1903) + * Fixing TypeError in GraphCommands.explain (#1901) + * For tests, increasing wait time for the cluster (#1908) + * Increased pubsub's wait_for_messages timeout to prevent flaky + tests (#1893) + * README code snippets formatted to highlight properly (#1888) + * Fix link in the main page (#1897) + * Documentation fixes: JSON Example, SSL Connection Examples, + RTD version (#1887) + * Direct link to readthedocs (#1885) +- Release 4.1.1 + * Add retries to connections in Sentinel Pools (#1879) + * OCSP Stapling Support (#1873) + * Define incr/decr as aliases of incrby/decrby (#1874) + * FT.CREATE - support MAXTEXTFIELDS, TEMPORARY, NOHL, NOFREQS, + SKIPINITIALSCAN (#1847) + * Timeseries docs fix (#1877) + * get_connection: catch OSError too (#1832) + * Set keys var otherwise variable not created (#1853) + * Clusters should optionally require full slot coverage (#1845) + * Triple quote docstrings in client.py PEP 257 (#1876) + * syncing requirements (#1870) + * Typo and typing in GraphCommands documentation (#1855) + * Allowing poetry and redis-py to install together (#1854) + * setup.py: Add project_urls for PyPI (#1867) + * Support test with redis unstable docker (#1850) + * Connection examples (#1835) + * Documentation cleanup (#1841) +- Release 4.1.0 + * OCSP stapling support (#1820) + * Support for SELECT (#1825) + * Support for specifying error types with retry (#1817) + * Support for RESET command since Redis 6.2.0 (#1824) + * Support CLIENT TRACKING (#1612) + * Support WRITE in CLIENT PAUSE (#1549) + * JSON set_file and set_path support (#1818) + * Allow ssl_ca_path with rediss:// urls (#1814) + * Support for password-encrypted SSL private keys (#1782) + * Support SYNC and PSYNC (#1741) + * Retry on error exception and timeout fixes (#1821) + * Fixing read race condition during pubsub (#1737) + * Fixing exception in listen (#1823) + * Fixed MovedError, and stopped iterating through startup nodes + when slots are fully covered (#1819) + * Socket not closing after server disconnect (#1797) + * Single sourcing the package version (#1791) + * Ensure redis_connect_func is set on uds connection (#1794) + * SRTALGO - Skip for redis versions greater than 7.0.0 (#1831) + * Documentation updates (#1822) + * Add CI action to install package from repository commit hash + (#1781) (#1790) + * Fix link in lmove docstring (#1793) + * Disabling JSON.DEBUG tests (#1787) + * Migrated targeted nodes to kwargs in Cluster Mode (#1762) + * Added support for MONITOR in clusters (#1756) + * Adding ROLE Command (#1610) + * Integrate RedisBloom support (#1683) + * Adding RedisGraph support (#1556) + * Allow overriding connection class via keyword arguments + (#1752) + * Aggregation LOAD * support for RediSearch (#1735) + * Adding cluster, bloom, and graph docs (#1779) + * Add packaging to setup_requires, and use >= to play nice to + setup.py (fixes #1625) (#1780) + * Fixing the license link in the readme (#1778) + * Removing distutils from tests (#1773) + * Fix cluster ACL tests (#1774) + * Improved RedisCluster's reinitialize_steps and documentation + (#1765) + * Added black and isort (#1734) + * Link Documents for all module commands (#1711) + * Pyupgrade + flynt + f-strings (#1759) + * Remove unused aggregation subclasses in RediSearch (#1754) + * Adding RedisCluster client to support Redis Cluster Mode + (#1660) + * Support RediSearch FT.PROFILE command (#1727) + * Adding support for non-decodable commands (#1731) + * COMMAND GETKEYS support (#1738) + * RedisJSON 2.0.4 behaviour support (#1747) + * Removing deprecating distutils (PEP 632) (#1730) + * Updating PR template (#1745) + * Removing duplication of Script class (#1751) + * Splitting documentation for read the docs (#1743) + * Improve code coverage for aggregation tests (#1713) + * Fixing COMMAND GETKEYS tests (#1750) + * GitHub release improvements (#1684) +- Release 4.0.2 + * Restoring Sentinel commands to redis client (#1723) + * Better removal of hiredis warning (#1726) + * Adding links to redis documents in function calls (#1719) +- Release 4.0.1 + * Removing command on initial connections (#1722) + * Removing hiredis warning when not installed (#1721) +- Release 4.0.0 + * FT.EXPLAINCLI intentionally raising NotImplementedError + * Restoring ZRANGE desc for Redis < 6.2.0 (#1697) + * Response parsing occasionally fails to parse floats (#1692) + * Re-enabling read-the-docs (#1707) + * Call HSET after FT.CREATE to avoid keyspace scan (#1706) + * Unit tests fixes for compatibility (#1703) + * Improve documentation about Locks (#1701) + * Fixes to allow --redis-url to pass through all tests (#1700) + * Fix unit tests running against Redis 4.0.0 (#1699) + * Search alias test fix (#1695) + * Adding RediSearch/RedisJSON tests (#1691) + * Updating codecov rules (#1689) + * Tests to validate custom JSON decoders (#1681) + * Added breaking icon to release drafter (#1702) + * Removing dependency on six (#1676) + * Re-enable pipeline support for JSON and TimeSeries (#1674) + * Export Sentinel, and SSL like other classes (#1671) + * Restore zrange functionality for older versions of Redis + (#1670) + * Fixed garbage collection deadlock (#1578) + * Tests to validate built python packages (#1678) + * Sleep for flaky search test (#1680) + * Test function renames, to match standards (#1679) + * Docstring improvements for Redis class (#1675) + * Fix georadius tests (#1672) + * Improvements to JSON coverage (#1666) + * Add python_requires setuptools check for python > 3.6 (#1656) + * SMISMEMBER support (#1667) + * Exposing the module version in loaded_modules (#1648) + * RedisTimeSeries support (#1652) + * Support for json multipath ($) (#1663) + * Added boolean parsing to PEXPIRE and PEXPIREAT (#1665) + * Add python_requires setuptools check for python > 3.6 (#1656) + * Adding vulture for static analysis (#1655) + * Starting to clean the docs (#1657) + * Update README.md (#1654) + * Adding description format for package (#1651) + * Publish to pypi as releases are generated with the release + drafter (#1647) + * Restore actions to prs (#1653) + * Fixing the package to include commands (#1649) + * Re-enabling codecov as part of CI process (#1646) + * Adding support for redisearch (#1640) Thanks @chayim + * redisjson support (#1636) Thanks @chayim + * Sentinel: Add SentinelManagedSSLConnection (#1419) Thanks + @AbdealiJK + * Enable floating parameters in SET (ex and px) (#1635) Thanks + @AvitalFineRedis + * Add warning when hiredis not installed. Recommend + installation. (#1621) Thanks @adiamzn + * Raising NotImplementedError for SCRIPT DEBUG and DEBUG + SEGFAULT (#1624) Thanks @chayim + * CLIENT REDIR command support (#1623) Thanks @chayim + * REPLICAOF command implementation (#1622) Thanks @chayim + * Add support to NX XX and CH to GEOADD (#1605) Thanks + @AvitalFineRedis + * Add support to ZRANGE and ZRANGESTORE parameters (#1603) + Thanks @AvitalFineRedis + * Pre 6.2 redis should default to None for script flush (#1641) + Thanks @chayim + * Add FULL option to XINFO SUMMARY (#1638) Thanks @agusdmb + * Geosearch test should use any=True (#1594) Thanks + @Andrew-Chen-Wang + * Removing packaging dependency (#1626) Thanks @chayim + * Fix client_kill_filter docs for skimpy (#1596) Thanks + @Andrew-Chen-Wang + * Normalize minid and maxlen docs (#1593) Thanks + @Andrew-Chen-Wang + * Update docs for multiple usernames for ACL DELUSER (#1595) + Thanks @Andrew-Chen-Wang + * Fix grammar of get param in set command (#1588) Thanks + @Andrew-Chen-Wang + * Fix docs for client_kill_filter (#1584) Thanks + @Andrew-Chen-Wang + * Convert README & CONTRIBUTING from rst to md (#1633) Thanks + @davidylee + * Test BYLEX param in zrangestore (#1634) Thanks + @AvitalFineRedis + * Tox integrations with invoke and docker (#1632) Thanks + @chayim + * Adding the release drafter to help simplify release notes + (#1618). Thanks @chayim + * BACKWARDS INCOMPATIBLE: Removed support for end of life + Python 2.7. #1318 + * BACKWARDS INCOMPATIBLE: All values within Redis URLs are + unquoted via urllib.parse.unquote. Prior versions of redis-py + supported this by specifying the ``decode_components`` flag + to the ``from_url`` functions. This is now done by default + and cannot be disabled. #589 + * POTENTIALLY INCOMPATIBLE: Redis commands were moved into a + mixin (see commands.py). Anyone importing ``redis.client`` to + access commands directly should import ``redis.commands``. + #1534, #1550 + * Removed technical debt on REDIS_6_VERSION placeholder. Thanks + @chayim #1582. + * Various docus fixes. Thanks @Andrew-Chen-Wang #1585, #1586. + * Support for LOLWUT command, available since Redis 5.0.0. + Thanks @brainix #1568. + * Added support for CLIENT REPLY, available in Redis 3.2.0. + Thanks @chayim #1581. + * Support for Auto-reconnect PubSub on get_message. Thanks + @luhn #1574. + * Fix RST syntax error in README/ Thanks @JanCBrammer #1451. + * IDLETIME and FREQ support for RESTORE. Thanks @chayim #1580. + * Supporting args with MODULE LOAD. Thanks @chayim #1579. + * Updating RedisLabs with Redis. Thanks @gkorland #1575. + * Added support for ASYNC to SCRIPT FLUSH available in Redis + 6.2.0. Thanks @chayim. #1567 + * Added CLIENT LIST fix to support multiple client ids + available in Redis 2.8.12. Thanks @chayim #1563. + * Added DISCARD support for pipelines available in Redis 2.0.0. + Thanks @chayim #1565. + * Added ACL DELUSER support for deleting lists of users + available in Redis 6.2.0. Thanks @chayim. #1562 + * Added CLIENT TRACKINFO support available in Redis 6.2.0. + Thanks @chayim. #1560 + * Added GEOSEARCH and GEOSEARCHSTORE support available in Redis + 6.2.0. Thanks @AvitalFine Redis. #1526 + * Added LPUSHX support for lists available in Redis 4.0.0. + Thanks @chayim. #1559 + * Added support for QUIT available in Redis 1.0.0. Thanks + @chayim. #1558 + * Added support for COMMAND COUNT available in Redis 2.8.13. + Thanks @chayim. #1554. + * Added CREATECONSUMER support for XGROUP available in Redis + 6.2.0. Thanks @AvitalFineRedis. #1553 + * Including slowly complexity in INFO if available. Thanks + @ian28223 #1489. + * Added support for STRALGO available in Redis 6.0.0. Thanks + @AvitalFineRedis. #1528 + * Addes support for ZMSCORE available in Redis 6.2.0. Thanks + @2014BDuck and @jiekun.zhu. #1437 + * Support MINID and LIMIT on XADD available in Redis 6.2.0. + Thanks @AvitalFineRedis. #1548 + * Added sentinel commands FLUSHCONFIG, CKQUORUM, FAILOVER, and + RESET available in Redis 2.8.12. Thanks @otherpirate. #834 + * Migrated Version instead of StrictVersion for Python 3.10. + Thanks @tirkarthi. #1552 + * Added retry mechanism with backoff. Thanks @nbraun-amazon. + #1494 + * Migrated commands to a mixin. Thanks @chayim. #1534 + * Added support for ZUNION, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1522 + * Added support for CLIENT LIST with ID, available in Redis + 6.2.0. Thanks @chayim. #1505 + * Added support for MINID and LIMIT with xtrim, available in + Reds 6.2.0. Thanks @chayim. #1508 + * Implemented LMOVE and BLMOVE commands, available in Redis + 6.2.0. Thanks @chayim. #1504 + * Added GET argument to SET command, available in Redis 6.2.0. + Thanks @2014BDuck. #1412 + * Documentation fixes. Thanks @enjoy-binbin @jonher937. #1496 + #1532 + * Added support for XAUTOCLAIM, available in Redis 6.2.0. + Thanks @AvitalFineRedis. #1529 + * Added IDLE support for XPENDING, available in Redis 6.2.0. + Thanks @AvitalFineRedis. #1523 + * Add a count parameter to lpop/rpop, available in Redis 6.2.0. + Thanks @wavenator. #1487 + * Added a (pypy) trove classifier for Python 3.9. Thanks @D3X. + #1535 + * Added ZINTER support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1520 + * Added ZINTER support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1520 + * Added ZDIFF and ZDIFFSTORE support, available in Redis 6.2.0. + Thanks @AvitalFineRedis. #1518 + * Added ZRANGESTORE support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1521 + * Added LT and GT support for ZADD, available in Redis 6.2.0. + Thanks @chayim. #1509 + * Added ZRANDMEMBER support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1519 + * Added GETDEL support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1514 + * Added CLIENT KILL laddr filter, available in Redis 6.2.0. + Thanks @chayim. #1506 + * Added CLIENT UNPAUSE, available in Redis 6.2.0. Thanks + @chayim. #1512 + * Added NOMKSTREAM support for XADD, available in Redis 6.2.0. + Thanks @chayim. #1507 + * Added HRANDFIELD support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1513 + * Added CLIENT INFO support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1517 + * Added GETEX support, available in Redis 6.2.0. Thanks + @AvitalFineRedis. #1515 + * Added support for COPY command, available in Redis 6.2.0. + Thanks @malinaa96. #1492 + * Provide a development and testing environment via docker. + Thanks @abrookins. #1365 + * Added support for the LPOS command available in Redis 6.0.6. + Thanks @aparcar #1353/#1354 + * Added support for the ACL LOG command available in Redis 6. + Thanks @2014BDuck. #1307 + * Added support for ABSTTL option of the RESTORE command + available in Redis 5.0. Thanks @charettes. #1423 +- Drop account-defaults-redis.patch merged upstream + ------------------------------------------------------------------- Fri Jul 16 09:15:51 UTC 2021 - Matej Cepl diff --git a/python-redis.spec b/python-redis.spec index 43c6392..9bbc605 100644 --- a/python-redis.spec +++ b/python-redis.spec @@ -1,7 +1,7 @@ # # spec file for package python-redis # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,27 +16,42 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 Name: python-redis -Version: 3.5.3 +Version: 4.3.3 Release: 0 Summary: Python client for Redis key-value store License: MIT Group: Development/Languages/Python -URL: https://github.com/andymccurdy/redis-py -Source: https://files.pythonhosted.org/packages/source/r/redis/redis-%{version}.tar.gz -# PATCH-FIX-UPSTREAM account-defaults-redis.patch gh#andymccurdy/redis-py#1499 mcepl@suse.com -# changing unit tests to account for defaults in redis -Patch0: account-defaults-redis.patch -BuildRequires: %{python_module mock} -BuildRequires: %{python_module pytest >= 2.7.0} +URL: https://github.com/redis/redis-py +Source0: https://files.pythonhosted.org/packages/source/r/redis/redis-%{version}.tar.gz +Source1: https://github.com/redis/redis-py/raw/v%{version}/tox.ini +BuildRequires: %{python_module Deprecated >= 1.2.3} +BuildRequires: %{python_module async-timeout >= 4.0.2} +BuildRequires: %{python_module base >= 3.6} +BuildRequires: %{python_module importlib-metadata >= 1.0 if %python-base < 3.8} +# requires mock.AsyncMock +BuildRequires: %{python_module mock if %python-base < 3.8} +BuildRequires: %{python_module packaging >= 20.4} +BuildRequires: %{python_module pytest-asyncio} +BuildRequires: %{python_module pytest-timeout} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module typing-extensions if %python-base < 3.8} BuildRequires: fdupes BuildRequires: psmisc BuildRequires: python-rpm-macros BuildRequires: redis +Requires: python-Deprecated >= 1.2.3 +Requires: python-async-timeout >= 4.0.2 +Requires: python-packaging >= 20.4 Requires: redis -Recommends: python-hiredis >= 0.1.3 +%if 0%{?python_version_nodots} < 38 +Requires: python-importlib-metadata >= 1.0 +Requires: python-typing-extensions +%endif +Recommends: python-hiredis >= 1.0.0 BuildArch: noarch %python_subpackages @@ -45,6 +60,8 @@ The Python interface to the Redis key-value store. %prep %autosetup -p1 -n redis-%{version} +# tox.ini for pytest markers +cp %{SOURCE1} . %build %python_build @@ -54,15 +71,34 @@ The Python interface to the Redis key-value store. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%{_sbindir}/redis-server --port 6379 & -%pytest - -killall redis-server +# upstream's tox testsuite starts several servers in docker containers listening on different ports. +# We just start two of them locally +# master +# https://github.com/redis/redis/pull/9920 +%{_sbindir}/redis-server --version | grep ' v=7\.' && redis7args="--enable-debug-command yes --enable-module-command yes" +%{_sbindir}/redis-server --port 6379 --save "" $redis7args & +victims="$!" +trap "kill $victims || true" EXIT +sleep 2 +# replica +%{_sbindir}/redis-server --port 6380 --save "" --replicaof localhost 6379 & +victims="$victims $!" +trap "kill $victims || true" EXIT +sleep 2 +# onlycluster: skip tests which require a full cluster +# redismod: Not available (https://github.com/RedisLabsModules/redismod) +# ssl: no stunnel with certs from docker container, fails at test collection +# +if [ $(getconf LONG_BIT) -ne 64 ]; then + # reference precision issues on 32-bit + donttest=" or test_geopos" +fi +%pytest -m 'not (onlycluster or redismod)' -k "not (dummyprefix $donttest)" --ignore tests/test_ssl.py %files %{python_files} %license LICENSE -%doc CHANGES README.rst +%doc README.md %{python_sitelib}/redis/ -%{python_sitelib}/redis-%{version}-py*.egg-info +%{python_sitelib}/redis-%{version}*-info %changelog diff --git a/redis-3.5.3.tar.gz b/redis-3.5.3.tar.gz deleted file mode 100644 index 6acbd8e..0000000 --- a/redis-3.5.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e7e0cfca8660dea8b7d5cd8c4f6c5e29e11f31158c0b0ae91a397f00e5a05a2 -size 141112 diff --git a/redis-4.3.3.tar.gz b/redis-4.3.3.tar.gz new file mode 100644 index 0000000..711e974 --- /dev/null +++ b/redis-4.3.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f7a57cf4af15cd543c4394bcbe2b9148db2606a37edba755368836e3a1d053e +size 4564562 diff --git a/redismod.conf b/redismod.conf new file mode 100644 index 0000000..7e782a8 --- /dev/null +++ b/redismod.conf @@ -0,0 +1,8 @@ +loadmodule /usr/lib/redis/modules/redisai.so +loadmodule /usr/lib/redis/modules/redisearch.so +loadmodule /usr/lib/redis/modules/redisgraph.so +loadmodule /usr/lib/redis/modules/redistimeseries.so +loadmodule /usr/lib/redis/modules/rejson.so +loadmodule /usr/lib/redis/modules/redisbloom.so +loadmodule /var/opt/redislabs/lib/modules/redisgears.so Plugin /var/opt/redislabs/modules/rg/plugin/gears_python.so Plugin /var/opt/redislabs/modules/rg/plugin/gears_jvm.so JvmOptions -Djava.class.path=/var/opt/redislabs/modules/rg/gear_runtime-jar-with-dependencies.jar JvmPath /var/opt/redislabs/modules/rg/OpenJDK/jdk-11.0.9.1+1/ + diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2f9b788 --- /dev/null +++ b/tox.ini @@ -0,0 +1,379 @@ +[pytest] +addopts = -s +markers = + redismod: run only the redis module tests + pipeline: pipeline tests + onlycluster: marks tests to be run only with cluster mode redis + onlynoncluster: marks tests to be run only with standalone redis + ssl: marker for only the ssl tests + asyncio: marker for async tests + replica: replica tests + experimental: run only experimental tests + +[tox] +minversion = 3.2.0 +requires = tox-docker +envlist = {standalone,cluster}-{plain,hiredis,ocsp}-{uvloop,asyncio}-{py36,py37,py38,py39,pypy3},linters,docs + +[docker:master] +name = master +image = redisfab/redis-py:6.2.6-buster +ports = + 6379:6379/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6379)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis6.2/master/redis.conf:/redis.conf + +[docker:replica] +name = replica +image = redisfab/redis-py:6.2.6-buster +links = + master:master +ports = + 6380:6380/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6380)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis6.2/replica/redis.conf:/redis.conf + +[docker:unstable] +name = unstable +image = redisfab/redis-py:unstable-bionic +ports = + 6378:6378/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6378)) else False" +volumes = + bind:rw:{toxinidir}/docker/unstable/redis.conf:/redis.conf + +[docker:unstable_cluster] +name = unstable_cluster +image = redisfab/redis-py-cluster:unstable-bionic +ports = + 6372:6372/tcp + 6373:6373/tcp + 6374:6374/tcp + 6375:6375/tcp + 6376:6376/tcp + 6377:6377/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(6372,6377)]) else False" +volumes = + bind:rw:{toxinidir}/docker/unstable_cluster/redis.conf:/redis.conf + +[docker:sentinel_1] +name = sentinel_1 +image = redisfab/redis-py-sentinel:6.2.6-buster +links = + master:master +ports = + 26379:26379/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26379)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_1.conf:/sentinel.conf + +[docker:sentinel_2] +name = sentinel_2 +image = redisfab/redis-py-sentinel:6.2.6-buster +links = + master:master +ports = + 26380:26380/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26380)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_2.conf:/sentinel.conf + +[docker:sentinel_3] +name = sentinel_3 +image = redisfab/redis-py-sentinel:6.2.6-buster +links = + master:master +ports = + 26381:26381/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26381)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_3.conf:/sentinel.conf + +[docker:redismod] +name = redismod +image = redislabs/redismod:edge +ports = + 36379:6379/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',36379)) else False" + +[docker:redis_cluster] +name = redis_cluster +image = redisfab/redis-py-cluster:6.2.6-buster +ports = + 16379:16379/tcp + 16380:16380/tcp + 16381:16381/tcp + 16382:16382/tcp + 16383:16383/tcp + 16384:16384/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16379,16384)]) else False" +volumes = + bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf + +[docker:redismod_cluster] +name = redismod_cluster +image = redisfab/redis-py-modcluster:6.2.6 +ports = + 46379:46379/tcp + 46380:46380/tcp + 46381:46381/tcp + 46382:46382/tcp + 46383:46383/tcp + 46384:46384/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(46379,46384)]) else False" +volumes = + bind:rw:{toxinidir}/docker/redismod_cluster/redis.conf:/redis.conf + +[docker:stunnel] +name = stunnel +image = redisfab/stunnel:latest +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6666)) else False" +links = + master:master +ports = + 6666:6666/tcp +volumes = + bind:ro:{toxinidir}/docker/stunnel/conf:/etc/stunnel/conf.d + bind:ro:{toxinidir}/docker/stunnel/keys:/etc/stunnel/keys + +[docker:redis5_master] +name = redis5_master +image = redisfab/redis-py:5.0-buster +ports = + 6382:6382/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6382)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/master/redis.conf:/redis.conf + +[docker:redis5_replica] +name = redis5_replica +image = redisfab/redis-py:5.0-buster +links = + redis5_master:redis5_master +ports = + 6383:6383/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6383)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/replica/redis.conf:/redis.conf + +[docker:redis5_sentinel_1] +name = redis5_sentinel_1 +image = redisfab/redis-py-sentinel:5.0-buster +links = + redis5_master:redis5_master +ports = + 26382:26382/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26382)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_1.conf:/sentinel.conf + +[docker:redis5_sentinel_2] +name = redis5_sentinel_2 +image = redisfab/redis-py-sentinel:5.0-buster +links = + redis5_master:redis5_master +ports = + 26383:26383/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26383)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_2.conf:/sentinel.conf + +[docker:redis5_sentinel_3] +name = redis5_sentinel_3 +image = redisfab/redis-py-sentinel:5.0-buster +links = + redis5_master:redis5_master +ports = + 26384:26384/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26384)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_3.conf:/sentinel.conf + +[docker:redis5_cluster] +name = redis5_cluster +image = redisfab/redis-py-cluster:5.0-buster +ports = + 16385:16385/tcp + 16386:16386/tcp + 16387:16387/tcp + 16388:16388/tcp + 16389:16389/tcp + 16390:16390/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16385,16390)]) else False" +volumes = + bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf + +[docker:redis4_master] +name = redis4_master +image = redisfab/redis-py:4.0-buster +ports = + 6381:6381/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6381)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/master/redis.conf:/redis.conf + +[docker:redis4_sentinel_1] +name = redis4_sentinel_1 +image = redisfab/redis-py-sentinel:4.0-buster +links = + redis4_master:redis4_master +ports = + 26385:26385/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26385)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_1.conf:/sentinel.conf + +[docker:redis4_sentinel_2] +name = redis4_sentinel_2 +image = redisfab/redis-py-sentinel:4.0-buster +links = + redis4_master:redis4_master +ports = + 26386:26386/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26386)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_2.conf:/sentinel.conf + +[docker:redis4_sentinel_3] +name = redis4_sentinel_3 +image = redisfab/redis-py-sentinel:4.0-buster +links = + redis4_master:redis4_master +ports = + 26387:26387/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26387)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_3.conf:/sentinel.conf + +[docker:redis4_cluster] +name = redis4_cluster +image = redisfab/redis-py-cluster:4.0-buster +ports = + 16391:16391/tcp + 16392:16392/tcp + 16393:16393/tcp + 16394:16394/tcp + 16395:16395/tcp + 16396:16396/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16391,16396)]) else False" +volumes = + bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf + +[isort] +profile = black +multi_line_output = 3 + +[testenv] +deps = + -r {toxinidir}/requirements.txt + -r {toxinidir}/dev_requirements.txt +docker = + unstable + unstable_cluster + master + replica + sentinel_1 + sentinel_2 + sentinel_3 + redis_cluster + redismod + redismod_cluster + stunnel +extras = + hiredis: hiredis + ocsp: cryptography, pyopenssl, requests +setenv = + CLUSTER_URL = "redis://localhost:16379/0" + UNSTABLE_CLUSTER_URL = "redis://localhost:6372/0" +commands = + standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' {posargs} + standalone-uvloop: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --uvloop {posargs} + cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} --redis-unstable-url={env:UNSTABLE_CLUSTER_URL:} {posargs} + cluster-uvloop: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} --redis-unstable-url={env:UNSTABLE_CLUSTER_URL:} --uvloop {posargs} + +[testenv:redis5] +deps = + -r {toxinidir}/requirements.txt + -r {toxinidir}/dev_requirements.txt +docker = + redis5_master + redis5_replica + redis5_sentinel_1 + redis5_sentinel_2 + redis5_sentinel_3 + redis5_cluster +extras = + hiredis: hiredis + cryptography: cryptography, requests +setenv = + CLUSTER_URL = "redis://localhost:16385/0" +commands = + standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster and not redismod' {posargs} + cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs} + +[testenv:redis4] +deps = + -r {toxinidir}/requirements.txt + -r {toxinidir}/dev_requirements.txt +docker = + redis4_master + redis4_sentinel_1 + redis4_sentinel_2 + redis4_sentinel_3 + redis4_cluster +extras = + hiredis: hiredis + cryptography: cryptography, requests +setenv = + CLUSTER_URL = "redis://localhost:16391/0" +commands = + standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster and not redismod' {posargs} + cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs} + +[testenv:devenv] +skipsdist = true +skip_install = true +deps = -r {toxinidir}/dev_requirements.txt +docker = {[testenv]docker} + +[testenv:linters] +deps_files = dev_requirements.txt +docker = +commands = + flake8 + black --target-version py36 --check --diff . + isort --check-only --diff . + vulture redis whitelist.py --min-confidence 80 + flynt --fail-on-change --dry-run . +skipsdist = true +skip_install = true + +[testenv:docs] +deps = -r docs/requirements.txt +docker = +changedir = {toxinidir}/docs +allowlist_externals = make +commands = make html + +[flake8] +max-line-length = 88 +exclude = + *.egg-info, + *.pyc, + .git, + .tox, + .venv*, + build, + docs/*, + dist, + docker, + venv*, + .venv*, + whitelist.py +ignore = + F405 + W503 + E203 + E126