From bb664d9862f1aa427744e34c51e7f2c1a8f35e15 Mon Sep 17 00:00:00 2001 From: jrconlin Date: Fri, 14 Jun 2024 14:25:02 -0700 Subject: [PATCH] bug: remove six requirement, add license classifer There are a few other "poetry" related changes that should be made, but I'm skipping those for now. Closes #166, 167 --- pyproject.toml | 9 ++++++++- pywebpush/__init__.py | 5 ++--- requirements.txt | 1 - setup.py | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) Index: pywebpush-2.1.0/pywebpush/__init__.py =================================================================== --- pywebpush-2.1.0.orig/pywebpush/__init__.py +++ pywebpush-2.1.0/pywebpush/__init__.py @@ -19,7 +19,6 @@ except ImportError: # pragma nocover import aiohttp import http_ece import requests -import six from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives import serialization @@ -175,7 +174,7 @@ class WebPusher: for k in ["p256dh", "auth"]: if keys.get(k) is None: raise WebPushException("Missing keys value: {}".format(k)) - if isinstance(keys[k], six.text_type): + if isinstance(keys[k], str): keys[k] = bytes(cast(str, keys[k]).encode("utf8")) receiver_raw = base64.urlsafe_b64decode( self._repad(cast(bytes, keys["p256dh"])) @@ -236,7 +235,7 @@ class WebPusher: format=serialization.PublicFormat.UncompressedPoint, ) - if isinstance(data, six.text_type): + if isinstance(data, str): data = bytes(data.encode("utf8")) if content_encoding == "aes128gcm": self.verb("Encrypting to aes128gcm...") Index: pywebpush-2.1.0/requirements.txt =================================================================== --- pywebpush-2.1.0.orig/requirements.txt +++ pywebpush-2.1.0/requirements.txt @@ -2,5 +2,4 @@ aiohttp cryptography>=2.6.1 http-ece>=1.1.0 requests>=2.21.0 -six>=1.15.0 py-vapid>=1.7.0