Skip to content

Commit

Permalink
Merge pull request #126 from wddimple6/Afkak-tests-with-murmurhash2
Browse files Browse the repository at this point in the history
BPSO 121038- Afkak tests with murmurhash2 against Kafka Version 1.1.1
  • Loading branch information
wddimple6 committed Aug 29, 2022
2 parents e39fab3 + fb21380 commit 42dfa05
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ jobs:

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"]
python-version: ["3.7", "3.8", "3.9", "pypy3"]

steps:
- uses: actions/checkout@v2

- name: Install build dependencies
run: |
sudo apt-get install -yqq build-essential libsnappy-dev
sudo apt-get -y install python3-distutils-extra
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
Expand Down
6 changes: 3 additions & 3 deletions afkak/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from random import randint

try:
from pyhash import murmur2_32 as _murmur2_32
_c_murmur2 = _murmur2_32(0x9747b28c)
from murmurhash2 import murmurhash2
_c_murmur2 = murmurhash2(b'', 0x9747b28c)
except ImportError: # pragma: no cover
_c_murmur2 = None

Expand Down Expand Up @@ -175,7 +175,7 @@ def _hash(self, key):
elif not isinstance(key, bytes):
raise TypeError('Partition key {!r} must be {} or {},'
' not {}'.format(key, type(b''), type(u''), type(key)))
return _c_murmur2(key)
return murmurhash2(key, 0x9747b28c)
else:
def _hash(self, key):
"""
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
# filenames to write.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', '_cache/python.inv'),
'twisted': ('https://twistedmatrix.com/documents/current/api/', '_cache/twisted.inv'),
'twisted': ('https://docs.twistedmatrix.com/en/stable/api/', '_cache/twisted.inv'),
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# versions.
python_requires='!=3.0.*, !=3.1.*, !=3.2.*, <4',
extras_require={
'FastMurmur2': ['pyhash'],
'FastMurmur2': ['murmurhash2'],
'snappy': ['python-snappy>=0.5'],
},

Expand Down
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minversion = 3.3.0
isolated_build = true
envlist =
py39-lint,
{py35,py36,py37,py38,py39}-{unit,unit-snappy-murmur},
{py37,py38,py39}-{unit,unit-snappy-murmur},
py39-int-snappy-murmur,
pypy3-{unit,unit-snappy}

Expand Down Expand Up @@ -72,7 +72,7 @@ commands =
[testenv:docs]
basepython = python3.9
deps =
Sphinx~=1.8.3
Sphinx~=5.1.1
changedir = docs
commands =
{toxinidir}/tools/download-intersphinx
Expand Down Expand Up @@ -106,8 +106,6 @@ include_trailing_comma = true

[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39
Expand Down

0 comments on commit 42dfa05

Please sign in to comment.