summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Install libmemcached-devgithub-actionsJon Parise2019-09-031-0/+1
|
* Remove .travis.ymlJon Parise2019-09-031-27/+0
|
* Pass the memcached portJon Parise2019-09-031-1/+1
|
* Try the built-in memcached serviceJon Parise2019-09-031-3/+7
|
* Update and rename pythonpackage.yml to tests.ymlJon Parise2019-09-031-0/+29
|
* Validate cas inputs as strings of digits (#250)Stephen Rosen2019-08-264-6/+54
| | | | | | | | | | | | | | | | | | | | For consideration for v3.0.0 'cas' is documented as needing to be an int or bytestring of the digits 0-9. However, this is not actually enforced and it is possible to pass a value to pymemcache which doesn't conform to these rules. In fact, you can do weird things like `cas=b'noreply'` and potentially trigger "unexpected" behavior. To go along with validating int inputs, validate cas inputs. However, these are not necessarily integers. Instead, if an int or string is given, it will be encoded as a bytestring. But in order to validate the value given, it is checked against isdigit() . (NB: You could also use `int(cas)` for very similar checking.) Rationale for allowing non-integer inputs to cas is not obvious. Presumably it allows callers using `gets()` to pass the `cas` value they get back into a `cas` command without issue. But it may be debatable.
* Change serialization interface to be an object (#245)Stephen Rosen2019-08-2610-109/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change serialization interface to be an object Rather than passing separate serialization and deserialization methods to a pymemcache client, pass an object implementing a very simple two-method interface. This is a rather significant breaking change and should be part of an x.0.0 major release. Resolves #56 As suggested in that issue, this is a cleaner interface, as there's no sensible context in which you would provide only one of these two methods and it should therefore be thought of as a serialization/deserialization protocol. Also adds a note to the documentation's Best Practices list that you should use the built-in serializer object unless you have a reason to do otherwise. * Support "de/serializer" in addition to "serde" In order to support older client usage in addition to the new serialization object (protocol), restore the "serializer" and "deserializer" arguments to the Client classes. These are marked as deprecated and will be automatically wrapped into a small "serde" object. In order to make the various object names more distinguishable and more informative, the built-in default serializer is now called "python_memcache_pickle_serde" Additionally, default client.serde to a "no-op serializer". This object does no transforms on the data. By putting this in place, we can skip some conditionals in the code around presence or absence of a serializer and therefore simplify internally (at the cost of an extra, unnecessary, functional call in some cases). It also simplifies logic around the handling of flags because we are now *guaranteed* the presence of a serializer object which returns some flags. i.e. "default flags" are no longer the responsibility of the various serializer usage sites. This is done carefully to ensure that passing a `serializer` without a `deserializer` is respected.
* Inaugurate pymemcache 3.0 developmentJon Parise2019-08-203-9/+9
|
* Check integer input values to Client methods (#243)Stephen Rosen2019-08-203-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a caller tries to send - a fractional expiration time - a string for the "incr" command - delay=None (instead of delay=0) The pymemcache base client will now catch these usage mistakes a throw a MemcacheIllegalInputError. Although there are existing valid (but undocumented) usages of the current string conversion behavior, the docs state that these values are supposed to be ints. Now if a non-int value is used, it will immediately trigger an error. This behavior is superior to the prior behavior especially in the case where a command is used with `noreply=True`. It can fail to parse, but the client won't pick up on this until the next call to memcache which reads the reply. The especially bad case we're seeking to avoid is this: from pymemcache.client.base import Client client = Client(("localhost", 11211)) client.set("foo", "bar", expire=1.5, noreply=True) client.get("foo") # triggers MemcacheUnknownCommandError Applies to all commands using `expire`, `delay`, incr and decr inputs, and memlimit. Because this is can be a breaking change for some users, the changelog entry is written under 3.0.0 (unreleased). closes #240
* Fix long_description string in Python packaging (#249)v2.2.2Jon Parise2019-08-065-9/+11
| | | | | When defining `long_description` in setup.cfg using the `file:` directive, we need to keep everything on one line. Otherwise, it will treat the value as a block of literal text.
* Fix flags when setting multiple values at once (#248)v2.2.1Jon Parise2019-08-054-10/+47
| | | | | | | | | | | | | | | | | | | | | We introduced the ability to override the serializer-returned flags values in 26f7c1b1. Unfortunately, there was a flaw in that logic which resulted in the first item's flags being used for all later items. This bug primarily affected set_many()'s behavior when the data dictionary contained multiple different value types which were assigned different per-value flags values by the serializer. For example: set_many({'a': 'string', 'b': 10}) If a serializer returned different flags for strings (e.g. 1) and integer values (e.g. 2), the previous logic would have set ``flags`` to 1 the first time through the loop and repeated that value for the second item, instead of using 2. This was the intended behavior when ``flags`` was explicitly passed to set_many(), but not for the default case where we still want to respect the flags values returned by the serializer.
* Add note about the overriding behavior of `flags` (#247)Jon Parise2019-08-011-4/+12
|
* Add Sphinx links to the exception classes (#246)Jon Parise2019-08-011-8/+8
|
* Set `long_description_content_type = text/x-rst`Jon Parise2019-07-301-0/+1
|
* Bump documentation version for 2.2.0 releasev2.2.0Jon Parise2019-07-301-2/+2
|
* Update changelog in preparation for v2.2.0 (#244)Jon Parise2019-07-301-2/+6
|
* Be more consistent about using Client.encoding (#242)Stephen Rosen2019-07-241-4/+6
| | | | | | | | | | | | | | This is a stylistic issue with little chance for actual impact. Some methods use 'ascii' verbatim and some use `self.encoding` (which defaults to 'ascii'). Those which are using `ascii` are only supposed to be accepting integer inputs, so this is actually fine. However, the result is a potentially confusing discrepancy -- why does `Client.touch` use `ascii` while `Client.add` uses `self.encoding`? To alleviate this potential confusion, be consistent about applying `self.encoding` to all memcached commands in the base client. This does not impact the `_check_key` func, which re-encodes potential unicode inputs as ASCII.
* Add noreply warning to getting_started doc (#241)Stephen Rosen2019-07-241-1/+13
| | | | | | | | | resolves #239 Add a warning to the Best Practices section of the Getting Started doc which explains the interaction between `noreply=True` and error handling. Also, fix a very minor typo, ``"noreply`` in a nearby line.
* Normalize the repository URL (#238)Jon Parise2019-07-051-1/+1
|
* extracted _extract_value() from _fetch_cmd() (#237)JianGuoPinterest2019-06-122-21/+68
| | | extract _extract_value() from _fetch_cmd() to support customized value extraction logic.
* add flags in client functions (#235)JianGuoPinterest2019-06-113-32/+75
| | | added flags in client functions to provide support for extra memcached operations.
* add encoding in client functions (#232)JianGuoPinterest2019-06-074-17/+120
|
* Drop official support for Python 3.4 (#234)Jon Parise2019-06-072-3/+0
| | | | Python 3.4 has reached end-of-life so remove it from the set of officially supported Python versions.
* Merge pull request #230 from jparise/changelog-2.2.0Joe Gordon2019-05-091-3/+5
|\ | | | | Update the changelog with recent changes
| * Update the changelog with recent changesJon Parise2019-05-091-3/+5
|/
* Merge pull request #228 from jparise/repr-quotesJoe Gordon2019-05-071-4/+4
|\ | | | | Remove redundant '' from %r values
| * Remove redundant '' from %r valuesJon Parise2019-05-071-4/+4
| | | | | | | | repr()'d strings (via %r) are already quoted.
* | Merge pull request #229 from jparise/ascii-encode-errorJoe Gordon2019-05-071-1/+2
|\ \ | |/ |/| Improve ASCII encoding failure exception
| * Improve ASCII encoding failure exceptionJon Parise2019-05-071-1/+2
|/ | | | | | Memcache can only store binary-safe values. We raise an exception when we're unable to encode a data value using the 'ascii' codec. Improve the exception message to make the error case clearer.
* Merge pull request #225 from cdonati/hash-default-noreplyJon Parise2019-04-191-1/+3
|\ | | | | Add default_noreply paramter to HashClient
| * Add default_noreply paramter to HashClientChris Donati2019-04-191-1/+3
|/ | | | | | This allows users to specify the noreply behavior upon creation of a HashClient like they are already able to do for Client and PooledClient.
* Merge pull request #223 from jogo/222Jon Parise2019-03-192-6/+9
|\ | | | | Handle unicode key values in MockMemcacheClient correctly
| * Handle unicode key values in MockMemcacheClient correctlyJoe Gordon2019-03-192-6/+9
|/ | | | | | | | The actual client tries to encode unicode and if it fails MemcacheIllegalInputError is raised. Fix the MockMemcacheClient to do the same thing. Fix bug #222
* Merge pull request #219 from 4383/packagingJon Parise2019-02-214-53/+45
|\ | | | | Introduce package metadata configuration by using setup.cfg
| * Introduce package metadata configuration by using setup.cfgHervé Beraud2019-02-214-53/+45
| | | | | | | | | | | | | | | | | | | | | | | | Since setuptools 30.3.0 we can use setup.cfg to configure package for build and distribute. These changes propose to adopt a more modern approach to package pymemcache by using latest and stable feature of setuptools. Overview: - remove python code to maintain - introduce package metadata, - centralize version management in package metadata
* | Merge pull request #220 from jparise/gitignore-eggsJon Parise2019-02-211-0/+1
|\ \ | |/ |/| Ignore the .eggs/ directory
| * Ignore the .eggs/ directoryJon Parise2019-02-211-0/+1
|/
* Merge pull request #217 from jparise/django-pymemcacheJon Parise2019-02-131-0/+7
|\ | | | | Mention django-pymemcache in the README
| * Mention django-pymemcache in the READMEJon Parise2019-02-131-0/+7
|/
* Merge pull request #218 from jparise/assert-equalsCharles Gordon2019-02-131-1/+1
|\ | | | | Use '==' to compare strings
| * Use '==' to compare stringsJon Parise2019-02-131-1/+1
|/
* Merge pull request #216 from jparise/setup-versionv2.1.1Jon Parise2019-01-284-13/+18
|\ | | | | Parse version directly from pymemcache/__init__.py
| * Parse version directly from pymemcache/__init__.pyJon Parise2019-01-284-13/+18
|/ | | | | | | | | | | We can no longer import the __version__ attribute because there is no an implicit runtime dependency on six (as of #197), and we can't guarantee that six is installed until *after* setup.py is parsed and run. Instead, parse the `__version__ = 'x.y.z'` string from __init__.py to extract the version. Fixes #214
* Merge pull request #212 from jparise/prepare-2.1.0v2.1.0Jon Parise2019-01-083-21/+28
|\ | | | | Finish preparing the 2.1.0 release
| * Finish preparing the 2.1.0 releaseJon Parise2019-01-083-21/+28
| | | | | | | | | | This updates the changelog and includes a final documentation cleanup pass.
* | Merge pull request #210 from jparise/coverage-omit-testsJon Parise2019-01-081-1/+4
|\ \ | |/ |/| Omit test/* code from the coverage report
| * Omit test/* code from the coverage reportJon Parise2019-01-071-1/+4
| |
* | Merge pull request #211 from jparise/cache_memlimitJon Parise2019-01-082-1/+24
|\ \ | | | | | | Add support for the 'cache_memlimit' command
| * | Add test coverage for the 'cache_memlimit' commandJon Parise2019-01-081-0/+8
| | |
| * | Improve the cache_memlimit documentationJon Parise2019-01-081-1/+2
| | |