From 196a4fbb2daea7a4f939a483c432da2ed44dcb54 Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Mon, 7 Dec 2020 17:11:03 +1000 Subject: [PATCH 1/5] removing numpy dependency --- opsgenie_sdk/api_client.py | 1 - templates/setup.mustache | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/opsgenie_sdk/api_client.py b/opsgenie_sdk/api_client.py index 1bcb071..f44a97c 100644 --- a/opsgenie_sdk/api_client.py +++ b/opsgenie_sdk/api_client.py @@ -24,7 +24,6 @@ # python 2 and python 3 compatibility library import six import tenacity -from numpy import long from six.moves.urllib.parse import quote from urllib3.exceptions import HTTPError diff --git a/templates/setup.mustache b/templates/setup.mustache index 684ee74..29e8ad6 100755 --- a/templates/setup.mustache +++ b/templates/setup.mustache @@ -18,7 +18,7 @@ VERSION = "{{packageVersion}}" # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.26.2", "six >= 1.10", "certifi", "python-dateutil", "numpy >= 1.16.3", "setuptools >= 21.0.0", "tenacity >= 5.0.4"] +REQUIRES = ["urllib3 >= 1.26.2", "six >= 1.10", "certifi", "python-dateutil", "setuptools >= 21.0.0", "tenacity >= 5.0.4"] {{#asyncio}} REQUIRES.append("aiohttp >= 3.0.0") {{/asyncio}} From a9e11f94a35b9617dfd9d05cdf0698d52d2a2616 Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Mon, 7 Dec 2020 17:13:21 +1000 Subject: [PATCH 2/5] removing numpy dependency --- opsgenie_sdk/rest.py | 1 - requirements.txt | 1 - setup.py | 2 +- templates/README_onlypackage.mustache | 1 - templates/api_client.mustache | 1 - templates/requirements.mustache | 1 - templates/rest.mustache | 1 - 7 files changed, 1 insertion(+), 7 deletions(-) diff --git a/opsgenie_sdk/rest.py b/opsgenie_sdk/rest.py index efbc759..cf2ec15 100644 --- a/opsgenie_sdk/rest.py +++ b/opsgenie_sdk/rest.py @@ -23,7 +23,6 @@ import certifi # python 2 and python 3 compatibility library import six -from numpy import long from six.moves.urllib.parse import urlencode from opsgenie_sdk import errors from .metrics import HttpMetric diff --git a/requirements.txt b/requirements.txt index 6499bce..fbc47bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,4 @@ six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.26.2 -numpy >= 1.16.3 tenacity >= 5.0.4 diff --git a/setup.py b/setup.py index fed79b1..e64402c 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.26.2", "six >= 1.10", "certifi", "python-dateutil", "numpy >= 1.16.3", "setuptools >= 21.0.0", "tenacity >= 5.0.4"] +REQUIRES = ["urllib3 >= 1.26.2", "six >= 1.10", "certifi", "python-dateutil", "setuptools >= 21.0.0", "tenacity >= 5.0.4"] with open("README.md", "r") as fh: long_description = fh.read() diff --git a/templates/README_onlypackage.mustache b/templates/README_onlypackage.mustache index 5f30208..d0dd1f4 100755 --- a/templates/README_onlypackage.mustache +++ b/templates/README_onlypackage.mustache @@ -29,7 +29,6 @@ To be able to use it, you will need these dependencies in your own package that * six >= 1.10 * certifi * python-dateutil -* numpy >= 1.16.3 * tenacity >= 5.0.4 {{#asyncio}} * aiohttp diff --git a/templates/api_client.mustache b/templates/api_client.mustache index 5b9013d..5cbc7cc 100755 --- a/templates/api_client.mustache +++ b/templates/api_client.mustache @@ -15,7 +15,6 @@ import uuid # python 2 and python 3 compatibility library import six import tenacity -from numpy import long from six.moves.urllib.parse import quote from urllib3.exceptions import HTTPError {{#tornado}} diff --git a/templates/requirements.mustache b/templates/requirements.mustache index 6499bce..fbc47bf 100755 --- a/templates/requirements.mustache +++ b/templates/requirements.mustache @@ -3,5 +3,4 @@ six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.26.2 -numpy >= 1.16.3 tenacity >= 5.0.4 diff --git a/templates/rest.mustache b/templates/rest.mustache index 3b2b805..5d31ede 100755 --- a/templates/rest.mustache +++ b/templates/rest.mustache @@ -14,7 +14,6 @@ import ssl import certifi # python 2 and python 3 compatibility library import six -from numpy import long from six.moves.urllib.parse import urlencode from {{packageName}} import errors from .metrics import HttpMetric From 8a210d598c13bc65469653c62d307eb3668ca252 Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Mon, 7 Dec 2020 19:02:04 +1000 Subject: [PATCH 3/5] removing unnecessary six check --- opsgenie_sdk/rest.py | 2 +- templates-original/rest.mustache | 2 +- templates/rest.mustache | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opsgenie_sdk/rest.py b/opsgenie_sdk/rest.py index cf2ec15..e1e1d87 100644 --- a/opsgenie_sdk/rest.py +++ b/opsgenie_sdk/rest.py @@ -152,7 +152,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, long)): # noqa: F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/templates-original/rest.mustache b/templates-original/rest.mustache index 772efe9..d332077 100755 --- a/templates-original/rest.mustache +++ b/templates-original/rest.mustache @@ -133,7 +133,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, long)): # noqa: F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/templates/rest.mustache b/templates/rest.mustache index 5d31ede..251d459 100755 --- a/templates/rest.mustache +++ b/templates/rest.mustache @@ -143,7 +143,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, long)): # noqa: F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): From e91ccebe6d055c017be950e25e5178c7a3a1481b Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Mon, 7 Dec 2020 19:03:58 +1000 Subject: [PATCH 4/5] removing unnecessary six check --- opsgenie_sdk/rest.py | 2 +- templates-original/rest.mustache | 2 +- templates/rest.mustache | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opsgenie_sdk/rest.py b/opsgenie_sdk/rest.py index cf2ec15..c2ac0f4 100644 --- a/opsgenie_sdk/rest.py +++ b/opsgenie_sdk/rest.py @@ -152,7 +152,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, six.integer_types): timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/templates-original/rest.mustache b/templates-original/rest.mustache index 772efe9..c00ee0c 100755 --- a/templates-original/rest.mustache +++ b/templates-original/rest.mustache @@ -133,7 +133,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, six.integer_types): timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/templates/rest.mustache b/templates/rest.mustache index 5d31ede..12b30f3 100755 --- a/templates/rest.mustache +++ b/templates/rest.mustache @@ -143,7 +143,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, six.integer_types): timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): From b72265099cb48b86dc1bafc8db3e5a559765b48e Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Mon, 7 Dec 2020 19:05:35 +1000 Subject: [PATCH 5/5] removing unnecessary six check --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d2a6c12 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/usr/bin/python" +} \ No newline at end of file