Releases: brainix/pottery
v3.0.1
This release includes asyncio implementations of Redlock and NextID
And a few other changes:
- Support Python 3.11, 3.12, and 3.13
- Warn when doing O(n) operations
- Switch from Python's built-in
unittesttopytest - Remove dependencies from
setup.py
What's Changed
- Flat is better than nested by @brainix in #628
- Upgrade requirements by @brainix in #629
- Preserve Open-Closed Principle with name mangling by @brainix in #630
- Upgrade requirements by @brainix in #631
- Unit test branch in Redlock._acquire_masters() by @brainix in #632
- Unit test additional branch in _log_synchronize() by @brainix in #633
- Upgrade requirements by @brainix in #634
- Upgrade requirements by @brainix in #635
- Warn when doing O(n) operations on HyperLogLogs by @brainix in #636
- Warn when doing O(n) operations on BloomFilters by @brainix in #637
- Warn when doing O(n) operations on RedisDicts by @brainix in #638
- Warn when doing O(n) operations on RedisLists by @brainix in #639
- Unit test branch in CachedOrderedDict.setitem by @brainix in #640
- Unit test add'l branch in RedisSet._populate() by @brainix in #641
- Warn when doing O(n) operations on RedisSets by @brainix in #642
- Design, implement, and test AIORedlock by @brainix in #643
- Fix validity time calc in AIORedlock.locked() by @brainix in #644
- Don't repeat myself by @brainix in #645
- Upgrade requirements by @brainix in #647
- Make NextId and Redlock Scripts classes parallel by @brainix in #649
- Design, implement, and test AIONextID by @brainix in #650
- Write additional AIORedlock unit tests by @brainix in #651
- Implement AIORedlock blocking and timeout by @brainix in #652
- Write additional AIORedlock unit tests by @brainix in #654
- Write additional AIONextID unit tests by @brainix in #655
- Upgrade requirements by @brainix in #656
- Write additional AIORedlock unit tests by @brainix in #657
- Implement and test .repr()s for AIO classes by @brainix in #658
- Upgrade requirements by @brainix in #659
- Document AIORedlock usage by @brainix in #646
- Add asyncio Trove classifier by @brainix in #660
- Write docstring for AIORedlock.init() by @brainix in #661
- Clean up asyncio unit tests and doctests by @brainix in #662
- Write docstring for AIORedlock.acquire() by @brainix in #663
- Test AIORedlock contention against 5 Redis masters by @brainix in #664
- Test Redlock contention against 5 Redis masters by @brainix in #665
- Make doctests run faster, and run them on CI by @brainix in #666
- Use uvloop instead of built-in asyncio event loop by @brainix in #667
- Use qualname instead of name in repr() by @brainix in #668
- Run asyncio in debug mode by @brainix in #669
- Switch from Python's built-in unittest to pytest by @brainix in #670
- Improve Redlock contention tests by @brainix in #672
- Test contention across 1-10 concurrent Redlocks by @brainix in #673
- Remove unnecessary for loop in unit test cleanup by @brainix in #674
- Use qualname instead of name in logs by @brainix in #675
- Don't make tests async unless they need to be by @brainix in #676
- Test AIONextID contention against 5 Redis masters by @brainix in #677
- Preserve Open-Closed Principle with name mangling by @brainix in #678
- Upgrade requirements by @brainix in #679
- Test NextID contention against 5 Redis masters by @brainix in #680
- Clean up requirements by @brainix in #681
- Write docstring for AIORedlock.locked() by @brainix in #682
- Write docstring for AIORedlock.extend() by @brainix in #683
- Write docstring for AIORedlock.release() by @brainix in #684
- Write docstring for AIORedlock.aenter() by @brainix in #685
- Make acquired a keyword-only arg by @brainix in #686
- Upgrade requirements by @brainix in #687
- Bump up redis to 4.2.2 by @KMilhan in #688
- Upgrade requirements by @brainix in #704
- Support Python 3.11 by @brainix in #705
- Upgrade setuptools on local development by @brainix in #706
- Delete incorrect comment by @brainix in #707
- Update for loop to use walrus operator by @brainix in #708
- Clean up BloomFilter.contains_many() by @brainix in #709
- fix GitHub workflow badge URL by @shoito in #711
- Upgrade requirements by @brainix in #712
- Support Python 3.12 by @brainix in #713
- Upgrade requirements by @brainix in #714
- Upgrade requirements by @brainix in #715
- Upgrade requirements by @brainix in #717
- Upgrade requirements by @brainix in #718
- Upgrade requirements by @brainix in #720
- Upgrade requirements by @brainix in #721
- Upgrade Python to 3.12.1 by @brainix in #722
- Remove args/kwargs from @_store_on_self(func) by @brainix in #726
- Upgrade requirements by @brainix in #727
- Happy new year! by @brainix in #728
- Upgrade requirements by @brainix in #729
- Upgrade requirements by @brainix in #730
- Upgrade requirements by @brainix in #731
- Upgrade requirements by @brainix in #732
- Upgrade requirements by @brainix in #736
- Upgrade Python to 3.12.2 by @brainix in #737
- Upgrade requirements by @brainix in #738
- Upgrade requirements by @brainix in #739
- Upgrade requirements by @brainix in #740
- Upgrade requirements by @brainix in #744
- Upgrade requirements by @brainix in #746
- Upgrade requirements by @brainix in #747
- Upgrade Python to 3.12.4 by @brainix in #748
- Upgrade requirements by @brainix in #749
- Upgrade requirements by @brainix in #752
- Remove no longer supported README badge by @brainix in #753
- Support Python 3.13 by @brainix in #754
- Upgrade requirements by @brainix in #756
- Upgrade Python to 3.13.1 by @brainix in #757
- Upgrade requirements by @brainix in #758
- Upgrade requirements by @brainix in #759
- Upgrade requirements by @brainix in #761
- Upgrade Python to 3.13.2 by @brainix in #762
- Happy new year! by @brainix in #763
- Make BloomFilterABC.len() consistent by @brainix in #764
- Simplify logic in BloomFilter.contains_many() by @brainix in https://gi...
v3.0.0
Breaking Change: Redlock now consistently uses seconds for all time units
In particular:
- The
auto_release_timeargument toRedlock.__init__()andsynchronize()is now in seconds (was previously milliseconds) Redlock.locked()now returns how much longer you'll hold the lease in seconds (or 0 if you don't hold the lock; and was also previously milliseconds)
What's Changed
- Remove superfluous return statement by @brainix in #626
- In Redlock, consistently measure time in seconds by @brainix in #627
Full Changelog: v2.3.7...v3.0.0
v2.3.7
Optimization: CachedOrderedDict.__init__()
Dramatically improve the performance of CachedOrderedDict.__init__(). Prior to this release, we were making multiple round trips to Redis, one per dict_key. As of this release, we make a single bulk call to Redis.
What's Changed
- Document NextId.init() kwargs in docstring by @brainix in #592
- Upgrade requirements by @brainix in #593
- Comment which Redis versions introduced commands by @brainix in #594
- Use dataclasses to define exception classes by @brainix in #595
- Share the same logger between monkey and base by @brainix in #596
- Upgrade Python to 3.10.2 by @brainix in #597
- Improve test coverage by @brainix in #598
- Check for security vulnerabilities by @brainix in #599
- Upgrade requirements by @brainix in #600
- Check for security vulnerabilities on local dev by @brainix in #601
- Upgrade requirements by @brainix in #602
- Upgrade requirements by @brainix in #603
- Implement RedisSet.contains() using SISMEMBER by @brainix in #604
- Lint on file save with Bandit by @brainix in #605
- Upgrade requirements by @brainix in #606
- Upgrade requirements by @brainix in #607
- Write union types as X | Y by @brainix in #608
- Tighten up type checking and type annotations by @brainix in #609
- Upgrade requirements by @brainix in #610
- Upgrade requirements by @brainix in #611
- Configure Bandit to not warn on asserts in tests by @brainix in #612
- Add emojis to README by @brainix in #613
- Write union types as X | Y by @brainix in #614
- Use protocol instead of making _Clearable an ABC by @brainix in #615
- Upgrade requirements by @brainix in #616
- Rename Base class to Container by @brainix in #617
- Refactor _Common class by @brainix in #618
- Clean up formatting by @brainix in #619
- Upgrade requirements by @brainix in #620
- Improve Redlock usage documentation by @brainix in #621
- Upgrade requirements by @brainix in #622
- Create a proper Pottery JSON encoder by @brainix in #623
- Refactor json.dumps() monkey patch by @brainix in #624
- Dramatically speed up CachedOrderedDict.init() by @brainix in #625
Full Changelog: v2.3.6...v2.3.7
v2.3.6
- Bug Fix: Properly configure logging for the Pottery library
- Optimization: Prefer Redis
UNLINKoverDEL;UNLINKis faster and non-blocking
What's Changed
- Happy new year! by @brainix in #577
- Upgrade requirements by @brainix in #578
- Prefer Redis UNLINK over DEL by @brainix in #579
- Comment which Redis versions introduced commands by @brainix in #580
- Upgrade requirements by @brainix in #581
- Preserve Open-Closed Principle with name mangling by @brainix in #582
- Upgrade requirements by @brainix in #583
- Define ABCs by subclassing abc.ABC by @brainix in #584
- Unit test that ABCs can't be instantiated by @brainix in #585
- Upgrade requirements by @brainix in #586
- Upgrade requirements by @brainix in #587
- Document Redlock.init() kwargs in docstrings by @brainix in #588
- Use isinstance() to provide a hint to Mypy by @brainix in #589
- Don't specify 'utf-8' argument to bytes.decode() by @brainix in #590
- Properly configure logging for the Pottery library by @brainix in #591
Full Changelog: v2.3.5...v2.3.6
v2.3.5
Bug Fix: Don't allow a RedisDeque to equal a RedisList...
...even if they're both on the same Redis instance and have the same key.
Before this release:
>>> from pottery import RedisDeque, RedisList
>>> RedisDeque(key='videos:dicts') == RedisList(key='videos:dicts')
TrueAs of this release:
>>> from pottery import RedisDeque, RedisList
>>> RedisDeque(key='videos:dicts') == RedisList(key='videos:dicts')
FalseWhat's Changed
- Make minor code cleanups by @brainix in #575
- Don't allow a RedisDeque to equal a RedisList... by @brainix in #576
Full Changelog: v2.3.4...v2.3.5
v2.3.4
Bug Fix: Don't allow RedisDeques to equal Python lists...
...even when they contain the same elements. Observe:
>>> import collections
>>> collections.deque([1, 2, 3]) == [1, 2, 3]
FalseWhat's Changed
Full Changelog: v2.3.3...v2.3.4
v2.3.3
Bug Fix: Don't allow RedisDeques to equal RedisLists...
...even when they contain the same elements. Observe:
>>> import collections
>>> collections.deque([1, 2, 3]) == [1, 2, 3]
FalseWhat's Changed
Full Changelog: v2.3.2...v2.3.3
v2.3.2
Bug Fix: Properly compare RedisLists on different Redis databases
Prior to this release, list1 == list2 would fail if both were RedisLists but on different Redis databases. This is because we'd try to use the same Redis pipeline for both lists. Fixed in #572.
What's Changed
- Reuse the ._same_redis() helper method by @brainix in #561
- Reorder methods in Primitive ABC to help subclass by @brainix in #562
- Use redis-py's .hscan_iter() and .sscan_iter() by @brainix in #563
- Preserve Open-Closed Principle with name mangling by @brainix in #564
- Simplify code using chunking and aliasing by @brainix in #565
- Name variables more consistently by @brainix in #566
- Use whitespace to make code more clear by @brainix in #567
- Preserve Open-Closed Principle with name mangling by @brainix in #568
- Refactor code in RedisCounter methods for clarity by @brainix in #569
- Simplify RedisDict._populate() by @brainix in #570
- Factor our RedisDict._encode_dict() by @brainix in #571
- Properly compare RedisLists on different Redis dbs by @brainix in #572
Full Changelog: v2.3.1...v2.3.2
v2.3.1
Bug Fix: More robustly test if two Redis clients talk to the same database
Previously, we were comparing the two clients' connection_kwargs, but connection_kwargs contains more than just host, port, and db:
>>> from redis import Redis
>>> redis = Redis()
>>> redis.connection_pool.connection_kwargs
{'db': 0, 'username': None, 'password': None, 'socket_timeout': None, 'encoding': 'utf-8', 'encoding_errors': 'strict', 'decode_responses': False, 'retry_on_error': [], 'retry': None, 'health_check_interval': 0, 'client_name': None, 'redis_connect_func': None, 'host': 'localhost', 'port': 6379, 'socket_connect_timeout': None, 'socket_keepalive': None, 'socket_keepalive_options': None}This PR allows Pottery to recognize that two Redis clients are connected to the same database even if their socket timeout our retry policies are different.
Bug Fix: Make RedisSet.contains_many() work for non-JSONifyable objects
v2.3.0
New Feature: RedisSimpleQueue
RedisSimpleQueue is a Redis-backed multi-producer, multi-consumer FIFO queue compatible with Python’s queue.SimpleQueue. In general, use a Python queue.Queue if you’re using it in one or more threads, use multiprocessing.Queue if you’re using it between processes, and use RedisSimpleQueue if you’re sharing it across machines or if you need for your queue to persist across application crashes or restarts.
What's Changed
Full Changelog: v2.2.2...v2.3.0