Skip to content

Commit 3bc7a25

Browse files
authored
chore: Upgrade dependencies (#204)
Notes: in new pytest, self.assertEquals has been deprecated and self.assertEqual is recommended. new pylint introduces a few new rules, which has been addressed in their dedicated commits.
2 parents 67f42dd + 89186de commit 3bc7a25

File tree

26 files changed

+114
-110
lines changed

26 files changed

+114
-110
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ confidence=
6060
# no Warning level messages displayed, use"--disable=all --enable=classes
6161
# --disable=W"
6262
# R0205,W0107,R1705,R1710,R1719,R1720,R1714 are all disable due to a forced upgrade to support python3.8
63-
disable=R0201,W0613,I0021,I0020,W1618,W1619,R0902,R0903,W0231,W0611,R0913,W0703,C0330,R0204,I0011,R0904,C0301, R0205,W0107,R1705,R1710,R1719,R1720,R1714
63+
# R1725,W0707 can be removed when we drop Python 2 support
64+
disable=R0201,W0613,I0021,I0020,W1618,W1619,R0902,R0903,W0231,W0611,R0913,W0703,C0330,R0204,I0011,R0904,C0301, R0205,W0107,R1705,R1710,R1719,R1720,R1714,R1725,W0707
6465

6566

6667
[REPORTS]

aws_lambda_builders/workflows/python_pip/packager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def main(self, args, env_vars=None, shim=None):
550550
class PipRunner(object):
551551
"""Wrapper around pip calls used by chalice."""
552552

553-
_LINK_IS_DIR_PATTERN = "Processing (.+?)\n" " Link is a directory," " ignoring download_dir"
553+
_LINK_IS_DIR_PATTERN = "Processing (.+?)\n Link is a directory, ignoring download_dir"
554554

555555
def __init__(self, python_exe, pip, osutils=None):
556556
if osutils is None:

requirements/dev.txt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
coverage==4.3.4
1+
coverage==5.3
22
flake8==3.3.0; python_version < '3.8'
3-
flake8==3.7.9; python_version >= '3.8'
4-
pytest-cov==2.4.0
5-
# astroid > 2.0.4 is not compatible with pylint1.7
6-
astroid>=1.5.8,<2.1.0; python_version < '3.8'
7-
pylint==1.7.2; python_version < '3.8'
8-
pylint==2.4.4; python_version >= '3.8'
3+
flake8==3.8.4; python_version >= '3.8'
4+
pytest-cov==2.10.1
5+
6+
# pylint 2 does not support Python 2. pylint 1.x requires astroid 1.x
7+
astroid~=1.6.0; python_version < '3.6'
8+
pylint~=1.9.5; python_version < '3.6'
9+
pylint~=2.6.0; python_version >= '3.6'
910
isort>=4.2.5,<5; python_version < '3.8'
1011

1112
# Test requirements
12-
pytest==3.0.7
13-
py==1.4.33
14-
mock==2.0.0
15-
parameterized==0.6.1
13+
pytest>=6.1.1; python_version >= '3.6'
14+
pytest~=4.6.11; python_version < '3.6' # pytest dropped python 2 support after 4.6.x
15+
mock==3.0.5; python_version < '3.6'
16+
mock==4.0.2; python_version >= '3.6'
17+
parameterized==0.7.4
1618
pathlib2==2.3.2; python_version<"3.4"
1719
futures==3.2.0; python_version<"3.2.3"
18-
# Py3.2 backport
19-
backports.tempfile==1.0
20+
21+
# tempfile backport for < 3.6
22+
backports.tempfile==1.0; python_version<"3.7"

tests/functional/test_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ def test_run_hello_workflow_with_exec_paths(self):
5959
with open(self.expected_filename, "r") as fp:
6060
contents = fp.read()
6161

62-
self.assertEquals(contents, self.expected_contents)
62+
self.assertEqual(contents, self.expected_contents)

tests/functional/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ def test_run_hello_workflow_with_backcompat(self, flavor, protocol_version):
104104
response = json.loads(stdout_data)
105105
self.assertNotIn("error", response)
106106
self.assertIn("result", response)
107-
self.assertEquals(response["result"]["artifacts_dir"], self.artifacts_dir)
107+
self.assertEqual(response["result"]["artifacts_dir"], self.artifacts_dir)
108108

109109
self.assertTrue(os.path.exists(self.expected_filename))
110110
contents = ""
111111
with open(self.expected_filename, "r") as fp:
112112
contents = fp.read()
113113

114-
self.assertEquals(contents, self.expected_contents)
114+
self.assertEqual(contents, self.expected_contents)
115115
shutil.rmtree(self.scratch_dir)
116116

117117
@parameterized.expand([("request_through_stdin"), ("request_through_argument")])
@@ -160,4 +160,4 @@ def test_run_hello_workflow_incompatible(self, flavor):
160160
# Validate the response object. It should be error response
161161
response = json.loads(stdout_data)
162162
self.assertIn("error", response)
163-
self.assertEquals(response["error"]["code"], 505)
163+
self.assertEqual(response["error"]["code"], 505)

tests/functional/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def test_must_respect_excludes_list(self):
3535
excludes = [".git", ".aws-sam", "*.pyc"]
3636

3737
copytree(self.source, self.dest, ignore=shutil.ignore_patterns(*excludes))
38-
self.assertEquals(set(os.listdir(self.dest)), {"nested", "a"})
39-
self.assertEquals(set(os.listdir(os.path.join(self.dest, "nested"))), set())
40-
self.assertEquals(set(os.listdir(os.path.join(self.dest, "a"))), {"c"})
41-
self.assertEquals(set(os.listdir(os.path.join(self.dest, "a"))), {"c"})
38+
self.assertEqual(set(os.listdir(self.dest)), {"nested", "a"})
39+
self.assertEqual(set(os.listdir(os.path.join(self.dest, "nested"))), set())
40+
self.assertEqual(set(os.listdir(os.path.join(self.dest, "a"))), {"c"})
41+
self.assertEqual(set(os.listdir(os.path.join(self.dest, "a"))), {"c"})
4242

4343

4444
def file(*args):

tests/functional/workflows/java_gradle/test_java_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def test_listdir(self):
3333
names = ["a", "b", "c"]
3434
for n in names:
3535
self.new_file(self.src, n)
36-
self.assertEquals(set(names), set(self.os_utils.listdir(self.src)))
36+
self.assertEqual(set(names), set(self.os_utils.listdir(self.src)))
3737

3838
def test_copy(self):
3939
f = self.new_file(self.src, "a")
4040
expected = os.path.join(self.dst, "a")
4141
copy_ret = self.os_utils.copy(f, expected)
42-
self.assertEquals(expected, copy_ret)
42+
self.assertEqual(expected, copy_ret)
4343
self.assertTrue("a" in os.listdir(self.dst))
4444

4545
def test_exists(self):

tests/functional/workflows/java_maven/test_java_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def test_listdir(self):
3333
names = ["a", "b", "c"]
3434
for n in names:
3535
self.new_file(self.src, n)
36-
self.assertEquals(set(names), set(self.os_utils.listdir(self.src)))
36+
self.assertEqual(set(names), set(self.os_utils.listdir(self.src)))
3737

3838
def test_copy(self):
3939
f = self.new_file(self.src, "a")
4040
expected = os.path.join(self.dst, "a")
4141
copy_ret = self.os_utils.copy(f, expected)
42-
self.assertEquals(expected, copy_ret)
42+
self.assertEqual(expected, copy_ret)
4343
self.assertTrue("a" in os.listdir(self.dst))
4444

4545
def test_exists(self):

tests/integration/workflows/custom_make/test_custom_make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_must_build_python_project_through_makefile(self):
4444
"chardet",
4545
"urllib3",
4646
"idna",
47-
"urllib3-1.25.10.dist-info",
47+
"urllib3-1.25.11.dist-info",
4848
"chardet-3.0.4.dist-info",
4949
"certifi-2020.4.5.2.dist-info",
5050
"certifi",
@@ -55,7 +55,7 @@ def test_must_build_python_project_through_makefile(self):
5555

5656
expected_files = self.test_data_files.union(dependencies_installed)
5757
output_files = set(os.listdir(self.artifacts_dir))
58-
self.assertEquals(expected_files, output_files)
58+
self.assertEqual(expected_files, output_files)
5959

6060
def test_must_build_python_project_through_makefile_unknown_target(self):
6161
with self.assertRaises(WorkflowFailedError):

tests/integration/workflows/dotnet_clipackage/test_dotnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_with_defaults_file(self):
4040

4141
output_files = set(os.listdir(self.artifacts_dir))
4242

43-
self.assertEquals(expected_files, output_files)
43+
self.assertEqual(expected_files, output_files)
4444

4545
def test_require_parameters(self):
4646
source_dir = os.path.join(self.TEST_DATA_FOLDER, "RequireParameters")
@@ -66,4 +66,4 @@ def test_require_parameters(self):
6666

6767
output_files = set(os.listdir(self.artifacts_dir))
6868

69-
self.assertEquals(expected_files, output_files)
69+
self.assertEqual(expected_files, output_files)

0 commit comments

Comments
 (0)