Skip to content

Commit

Permalink
Drop six requirement, already py3 only (#24)
Browse files Browse the repository at this point in the history
Drop not needed dependency (six) anymore.
  • Loading branch information
ferhatelmas committed Apr 28, 2020
1 parent d63a22a commit e51c4fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Apr 28, 2020 - 1.3.0
- Drop six dependency

## Apr 17, 2020 - 1.2.2
- Fix version number

Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@

requests = "requests>=2.22.0,<3"

install_requires = [
"pycryptodomex>=3.8.1,<4",
requests,
"pyjwt==1.7.1",
"six>=1.12.0",
]
install_requires = ["pycryptodomex>=3.8.1,<4", requests, "pyjwt==1.7.1"]
long_description = open("README.md", "r").read()
tests_require = ["pytest"]

about = {}
with open("stream_chat/__pkg__.py") as fp:
exec(fp.read(), about)


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
Expand All @@ -27,14 +23,20 @@ def finalize_options(self):
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest

pytest_cmd = ["stream_chat/", "-v"]

try:
import pytest_cov
pytest_cmd += ["--cov=stream_chat/", "--cov-report=html", "--cov-report=annotate"]

pytest_cmd += [
"--cov=stream_chat/",
"--cov-report=html",
"--cov-report=annotate",
]
except ImportError:
pass

errno = pytest.main(pytest_cmd)
sys.exit(errno)

Expand All @@ -55,7 +57,7 @@ def run_tests(self):
extras_require={"test": tests_require},
tests_require=tests_require,
include_package_data=True,
python_requires='>=3.5',
python_requires=">=3.5",
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
Expand Down
5 changes: 1 addition & 4 deletions stream_chat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import jwt
import requests
import six

from stream_chat.__pkg__ import __version__
from stream_chat.channel import Channel
Expand Down Expand Up @@ -286,9 +285,7 @@ def verify_webhook(self, request_body, x_signature):
:return: bool
"""
signature = hmac.new(
key=six.b(self.api_secret),
msg=six.b(request_body),
digestmod=hashlib.sha256,
key=self.api_secret.encode(), msg=request_body, digestmod=hashlib.sha256
).hexdigest()
return signature == x_signature

Expand Down

0 comments on commit e51c4fa

Please sign in to comment.