Skip to content

Commit 140d0b2

Browse files
Update dependencies and Python compatibility to address security vulnerabilities (#82)
* Update dependencies and Python compatibility Change pip install to pip3 install in bootstrap script for clarity. Remove future package with security vulnerabilities from setup.py dependencies. Update tox.ini to support Python 3.8 to 3.12 and remove older Python versions. Refactor client.py to eliminate usage of future library, replacing it with standard library methods. * Re-add python 3.7 environment to tox config * Re-add all python 3 versions to tox config --------- Co-authored-by: Arpit Shah <[email protected]>
1 parent 6edf505 commit 140d0b2

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "Installing dependencies..."
66
python3 setup.py install
77

88
echo "Installing twine..."
9-
pip install twine
9+
pip3 install twine

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def run_tests(self):
7575
long_description_content_type="text/markdown",
7676
install_requires=[
7777
'boto>=2.48.0',
78-
'future>=0.17.1',
7978
'requests>=2.20.0',
8079
'python-dateutil>=2.7.5',
8180
],

src/vinyldns/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
from builtins import str
2020

2121
import requests
22-
from future.moves.urllib.parse import parse_qs
23-
from future.utils import iteritems
22+
from urllib.parse import parse_qs
2423
from requests.adapters import HTTPAdapter
2524
# Python 2/3 compatibility
2625
from requests.compat import urljoin
@@ -153,7 +152,7 @@ def __make_request(self, url, method=u'GET', headers=None, body_string=None, **k
153152
# the problem with parse_qs is that it will return a list for ALL params, even if they are a single value
154153
# we need to essentially flatten the params if a param has only one value
155154
query = dict((k, v if len(v) > 1 else v[0])
156-
for k, v in iteritems(query))
155+
for k, v in query.items())
157156

158157
signed_headers, signed_body = self.__build_vinyldns_request(method, path, body_string, query,
159158
with_headers=headers or {}, **kwargs)
@@ -215,7 +214,7 @@ def canonical_header_name(field_name):
215214
u'Date': now.strftime(u'%a, %d %b %Y %H:%M:%S GMT'),
216215
u'X-Amz-Date': now.strftime(u'%Y%m%dT%H%M%SZ')}
217216

218-
for k, v in iteritems(new_headers):
217+
for k, v in new_headers.items():
219218
headers[canonical_header_name(k)] = v
220219

221220
for k in map(canonical_header_name, suppressed_keys):

tox.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
envlist =
55
clean,
66
check,
7-
{py27,py34,py35,py36,py37},
7+
{py34,py35,py36,py37,py38,py39,py310,py311},
88
report,
99
func_test
1010

1111
[testenv]
1212
basepython =
13-
py27: {env:TOXPYTHON:python2.7}
1413
py34: {env:TOXPYTHON:python3.4}
1514
py35: {env:TOXPYTHON:python3.5}
1615
py36: {env:TOXPYTHON:python3.6}
1716
py37: {env:TOXPYTHON:python3.7}
17+
py38: {env:TOXPYTHON:python3.8}
18+
py39: {env:TOXPYTHON:python3.9}
19+
py310: {env:TOXPYTHON:python3.10}
20+
py311: {env:TOXPYTHON:python3.11}
1821
{clean,check,report,codecov,func_test}: {env:TOXPYTHON:python3}
1922
setenv =
2023
PYTHONPATH={toxinidir}/tests
@@ -24,7 +27,6 @@ passenv =
2427
usedevelop = true
2528
deps =
2629
pytest
27-
pytest-travis-fold
2830
pytest-cov
2931
responses
3032
python-dateutil
@@ -68,10 +70,9 @@ commands_post =
6870
bash -c ./docker/remove-vinyl-containers.sh
6971
commands =
7072
{posargs:pytest -vv func_tests}
71-
whitelist_externals =
73+
allowlist_externals =
7274
bash
7375

7476
[travis]
7577
python =
76-
2.7: check, py27
77-
3.6: check, py36, func_test
78+
3.11: check, py311, func_test

0 commit comments

Comments
 (0)