summaryrefslogtreecommitdiff
path: root/pymemcache
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade to black 23.3.0Joe Gordon2023-04-054-6/+0
| | | | | | https://github.com/psf/black/blob/main/CHANGES.md Run latest version of black to fix formatting issues
* Fix test_compressed_complex failure on 32-bit platformsmisuzu2023-02-061-3/+2
| | | | | | | | | | This test was written with the assumption that sys.maxsize is equal to 2**63 - 1 everywhere. sys.maxsize is equal to 2**31 - 1 on a 32-bit platforms and 2**63 - 1 on a 64-bit platforms. See also https://docs.python.org/3/library/sys.html#sys.maxsize
* Consistent behaviour for incr, decr for Hash and Base (#476)Matej Spiller Muys2023-02-021-2/+2
| | | Co-authored-by: Matej Spiller Muys <matej.spiller-muys@bitstamp.net>
* Support for Gat and Gats, Support passing server key in a tupleMatej Spiller Muys2023-01-315-32/+196
|
* Merge pull request #428 from jogo/4.0.0v4.0.0Joe Gordon2022-10-171-1/+1
|\ | | | | 4.0.0 Release
| * 4.0.0 ReleaseJoe Gordon2022-10-071-1/+1
| | | | | | | | Update changelog and version
* | Fix key_prefix issue with stats and cache_memlimitJoe Gordon2022-10-143-44/+80
|/ | | | | | | Add integration tests to reproduce the issue and add an argument to _fetch_cmd to skip the key prefix logic as needed. Closes #430
* Merge pull request #426 from jogo/typingJoe Gordon2022-10-033-88/+193
|\ | | | | Add more type annotations
| * Add more type annotationsJoe Gordon2022-10-033-88/+193
| | | | | | | | Continue to improve the type annotation coverage
* | Add py.typed fileJoe Gordon2022-09-211-0/+0
|/ | | | | As per https://peps.python.org/pep-0561/ add a py.typed file to let things like mypy there is inline typing information
* Start to add type hintsJoe Gordon2022-09-123-65/+125
| | | | | First pass at adding some type hints to pymemcache to make it easier to develop against etc.
* set min_compress_lenJohn Anderson2022-07-151-1/+2
|
* fix mypyJohn Anderson2022-07-151-1/+1
|
* flake8John Anderson2022-07-151-53/+30
|
* add some compression benchmarksJohn Anderson2022-07-153-13/+250
|
* add pluggable compression serdeJohn Anderson2022-07-123-33/+223
|
* Expand Client with a method for sending arbitrary commands. (#395)Martin J2022-06-092-2/+129
|
* Small buffer pass optimization as discussed in #395. (#402)Martin J2022-06-071-4/+7
| | | | Basically ensure the client only does one pass over the buffer instead of two. Exact thread: https://github.com/pinterest/pymemcache/pull/395#discussion_r890288417
* Skip test_tls until certificate is updatedJoe Gordon2022-05-311-0/+1
| | | | See https://github.com/pinterest/pymemcache/issues/396 for more details
* Handle a blank stat value (#388)liquidpele2022-03-252-1/+6
| | | | | | | | | | | | | | | | | | | | | | A stat with a blank value makes the .stats() call fail with index error. ``` memcache_connection.stats() File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 741, in stats result = self._fetch_cmd(b'stats', args, False) File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 921, in _fetch_cmd result[key_value[1]] = key_value[2] IndexError: list index out of range ``` The line in question we saw that caused this: ``` b'STAT ep_initfile ' ``` This fixes things to no longer blow up. I chose to use a blank binary string instead of None because I suspect other code might make assumptions about the data being binary strings due to this bug. Co-authored-by: reecepeg <reecepeg@amazon.com>
* Formalize typing for server specifications (#376)Jon Parise2022-02-223-31/+31
| | | | | This also drops support for passing None as a server spec, which is something many tests were doing out of lazy convenience. I can't think of a reason why we'd want to support that for real world usage.
* Initial support for mypy-based type checking (#373)Jon Parise2022-02-202-3/+3
|
* Upgrade to Black 22.1.0 (from 22.11b1) (#364)Jon Parise2022-02-091-1/+1
| | | | | Black and its style guide are now officially stable. Future releases will allow incremental adoption of new style changes via a new --preview system.
* Support noreply for hash flush_allJoe Gordon2022-01-212-2/+6
| | | | | | | The regular client supports noreply so pass args, kwargs like for other functions in hash client Fixes issue #360
* Apply black formattingJoe Gordon2021-12-0319-1446/+1465
| | | | https://black.readthedocs.io/en/stable/index.html
* fix typo (#356)Jürgen Gmach2021-11-181-1/+1
|
* Return default from hash client when using positional argument (#354)Ludwig Hähne2021-10-152-5/+17
| | | | | | | | | | | | When using HashClient with ignore_exc, get would always return None if no server is available and the default is passed as a positional argument. The other clients return the default value in this case. An earlier fix only had the desired effect when passing default as a keyword argument. For example, Django passes the default as a positional argument. Return the default value so HashClient behaves like the other clients.
* Return default from hash client (#352)Ludwig H2021-10-042-1/+4
|
* Use default for get ignore_excJoe Gordon2021-09-222-1/+11
| | | | | | | ignore_exc should treat an error as a cache miss and default specifies what should be returned on a miss. Fixes issue #350
* docs: Fix a few typos (#348)Tim Gates2021-09-133-8/+8
|
* Merge pull request #321 from jogo/EOLJon Parise2021-07-2015-195/+119
|\
| * Fixes for rebase and further cleanupsJoe Gordon2021-07-208-40/+22
| |
| * Remove PY2 specific imports and testsJoe Gordon2021-07-202-32/+0
| | | | | | | | | | * future was needed for some python 2 specific tests * use mock from unittest.mock instead of the 3rd party mock library
| * Remove six dependency and run pyupgradeJoe Gordon2021-07-2014-128/+102
| | | | | | | | | | | | | | Now that we don't require Python 2 support no need for six. Code upgraded with pyupgrade and manual fixes to remove remaining six usage.
* | Bump version to 4.0.0-devJon Parise2021-07-201-1/+1
|/
* Prepare the v3.5.0 release (#341)v3.5.0Hervé Beraud2021-07-131-1/+1
|
* Merge pull request #324 from martinnj/feature/retrying-clientCharles Gordon2021-07-123-0/+502
|\ | | | | Implement RetryingClient
| * Add RetryingClient. Fixes #307Martin Jørgensen2021-07-133-0/+502
| |
* | [py27] Fixing a bug with bad conditions (#337)Hervé Beraud2021-07-062-2/+42
| |
* | Configure the socket keepalive from various clients (#338)Hervé Beraud2021-07-052-0/+5
| |
* | Allow us to import the KeepalivOpts from the root pymemcache namespace (#340)Hervé Beraud2021-07-051-0/+1
| |
* | Fix doc rendering (#339)Hervé Beraud2021-07-051-14/+10
| |
* | Ensure us to close socket on MemcacheUnexpectedCloseErrorHervé Beraud2021-07-012-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During network maintenance operations or during server reboot users could face MemcacheUnexpectedCloseError. This kind of exception will be raised down the stack. It's a design choice [1]. Users should manage this kind of exception. However, at some points the opened sockets remains more or less opened after this kind of fail on the client side [2]. It will require n+1 calls to see them recreated when the connection will be possible. That's could be problem with services that implement several cache logics in parallel and where their clients are based on pymemcache. These changes simply ensure to close the socket properly. The socket will be recreated by the client if needed. [1] https://github.com/pinterest/pymemcache/issues/307 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1977711
* | Reduce method complexity to pass linter testsHervé Beraud2021-07-011-8/+8
| | | | | | | | | | | | | | | | The _store_cmd method became a bit to complexe and the linter complains when we add new conditions or try/except clause. These changes outsource some some processsing to reduce the complexity of the method.
* | Implement socket keepalive configuration mechanisms (#332)Hervé Beraud2021-07-012-1/+147
| |
* | Client API for server shutdown protocol command (#328)LINKIWI2021-06-212-0/+44
| |
* | Provide a mock implementation of socket.getaddrinfo (#327)Jon Parise2021-06-181-4/+20
|/ | | | | | | 9551dfd0 introduced a call to socket.getaddrinfo() to support IPv6, but we never added an implementation of that function to MockSocketModule. This resulted in some tests making "live" socket.getaddrinfo() calls because of the default MockSocketModule.__getattr__ implementation (which we need to forward other module attribute lookups).
* Prepare version 3.4.4 (#322)v3.4.4Jon Parise2021-06-021-1/+1
|
* Remove idle connections from pool (#309)Jordan Carlson2021-06-014-7/+59
| | | | | | The Memcached server can be configured to drop idle connections (via the idle_timeout option). When this occurs, pymemcache may still try to use the connection, resulting in MemcacheUnexpectedCloseError. Hence the need for client-side idle timeout logic.
* Use client.set_many in HashClient.Martin Jørgensen2021-05-272-9/+6
|