Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support redis-py 3.0.0 #344

Merged
merged 5 commits into from
Nov 19, 2018
Merged

Add support redis-py 3.0.0 #344

merged 5 commits into from
Nov 19, 2018

Conversation

jdufresne
Copy link
Member

  • Make CacheKey inherit from str to fix exception "Only bytes, strings and numbers (ints, longs and floats) are acceptable for keys and values."
  • .exists() now returns and integer, so update .has_key().
  • Remove erroneous tests so all tests pass again.
  • Fix flake8 errors.

Fixes #342

@michael-k
Copy link
Contributor

Extending tox.ini and .travis.yml to run tests against redis < 3 as well as >= 3 would be nice.

@jdufresne
Copy link
Member Author

@michael-k Good call! In the latest version I've updated tox & Travis to test against both redis-py 2.x and 3.x. Thanks for the suggestion.

TheOldMop and others added 4 commits November 16, 2018 07:40
django_redis/client/default.py:37:41: W504 line break after binary operator
tests/test_backend.py:548:21: W504 line break after binary operator
tests/test_backend.py:550:22: W504 line break after binary operator
tests/test_backend.py:604:22: W504 line break after binary operator
Session data is always text.
- Make CacheKey inherit from str to fix exception "Only bytes, strings
  and numbers (ints, longs and floats) are acceptable for keys and
  values."
- .exists() now returns and integer, so update .has_key().
- Update test matrix to include tests for both redis-py 2.x and the
  latest version.

Fixes #342
@jdufresne
Copy link
Member Author

@TheOldMop I've incorporated your test fixes from #335 so we can verify all tests pass. Thanks!

@terencehonles
Copy link
Contributor

@jdufresne I didn't notice this on the queue, but not sure if you want to look at terencehonles@a4f7781 for the CacheKey implementation I had (was just about to create a PR)

@jdufresne
Copy link
Member Author

Thanks. Looks mostly identical.

@niwinz
Copy link
Collaborator

niwinz commented Nov 19, 2018

Nice work! Thank you all.

@niwinz niwinz merged commit b958fd8 into jazzband:master Nov 19, 2018
@jdufresne jdufresne deleted the redis3 branch November 24, 2018 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

django-redis is incompatible with redis-py >= 3
5 participants