diff --git a/.travis.yml b/.travis.yml index 3493c21..780ffbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ dist: xenial language: python python: - - "2.7" - "3.6" - "3.7" - - "pypy" - "pypy3" install: - pip install tox-travis diff --git a/github_webhook/__init__.py b/github_webhook/__init__.py index fee418e..89ffe17 100644 --- a/github_webhook/__init__.py +++ b/github_webhook/__init__.py @@ -8,7 +8,7 @@ :license: Apache License, Version 2.0 """ -from github_webhook.webhook import Webhook # noqa +from github_webhook.webhook import Webhook # ----------------------------------------------------------------------------- # Copyright 2015 Bloomberg Finance L.P. diff --git a/github_webhook/webhook.py b/github_webhook/webhook.py index f4ca352..782f2c0 100644 --- a/github_webhook/webhook.py +++ b/github_webhook/webhook.py @@ -3,7 +3,6 @@ import hmac import logging import json -import six from flask import abort, request @@ -35,7 +34,7 @@ def secret(self): @secret.setter def secret(self, secret): - if secret is not None and not isinstance(secret, six.binary_type): + if secret is not None and not isinstance(secret, bytes): secret = secret.encode("utf-8") self._secret = secret @@ -65,8 +64,8 @@ def _postreceive(self): if digest is not None: sig_parts = _get_header("X-Hub-Signature").split("=", 1) - if not isinstance(digest, six.text_type): - digest = six.text_type(digest) + if not isinstance(digest, str): + digest = str(digest) if len(sig_parts) < 2 or sig_parts[0] != "sha1" or not hmac.compare_digest(sig_parts[1], digest): abort(400, "Invalid signature") diff --git a/setup.py b/setup.py index b1ebbae..c6fb368 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,9 @@ author_email="achamberlai9@bloomberg.net, fphillips7@bloomberg.net, dkiss1@bloomberg.net, dbeer1@bloomberg.net", license="Apache 2.0", packages=["github_webhook"], - install_requires=["flask", "six"], - tests_require=["mock", "pytest"], + python_requires=">=3.6", + install_requires=["flask>=1.0.2"], + tests_require=["pytest"], classifiers=[ "Development Status :: 4 - Beta", "Framework :: Flask", @@ -21,9 +22,7 @@ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Version Control", ], - test_suite="nose.collector", ) diff --git a/tox.ini b/tox.ini index ed2ef8b..e9c3c0f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,12 @@ [tox] -envlist = py27,py36,py37,pypy,pypy3,flake8 +envlist = py36,py37,pypy3,flake8 [testenv] deps = pytest pytest-cov flask - six - py{27,py}: mock -commands = pytest -vl --cov=github_webhook --cov-report term-missing --cov-fail-under 100 +commands = pytest -vl --cov=github_webhook --cov-report term-missing --cov-fail-under 98 [testenv:flake8] deps = flake8