Skip to content

Commit 0f4dc6e

Browse files
authored
Updates to handle new pylint requirements (#196)
* pylint max-attributes appears to be ratcheted down recently * remove unnecessary comprehensions * whitelist some pylint use-constant-test false-positives * reorganize backwards compatibility test requirements definitions attrs==19.2.0 removed a deprecated feature that aws-encryption-sdk==1.3.3 depended on. This reorganization lets us define specific requirements bounds for old versions of aws-encryption-sdk that will probably continue to be necessary as these old versions age. * remove unnecessary comprehensions * add newlines to the end of all requirements files
1 parent 6a309ed commit 0f4dc6e

File tree

16 files changed

+21
-15
lines changed

16 files changed

+21
-15
lines changed

decrypt_oracle/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_version():
2222
def get_requirements():
2323
"""Read the requirements file."""
2424
requirements = read("requirements-actual.txt")
25-
return [r for r in requirements.strip().splitlines()]
25+
return list(requirements.strip().splitlines())
2626

2727

2828
setup(

doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
sphinx>=1.3.0
2-
sphinx_rtd_theme
2+
sphinx_rtd_theme

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
boto3>=1.4.4
22
cryptography>=1.8.1
33
attrs>=17.4.0
4-
wrapt>=1.10.11
4+
wrapt>=1.10.11

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_version():
2222
def get_requirements():
2323
"""Reads the requirements file."""
2424
requirements = read("requirements.txt")
25-
return [r for r in requirements.strip().splitlines()]
25+
return list(requirements.strip().splitlines())
2626

2727

2828
setup(

src/aws_encryption_sdk/caches/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class CryptoMaterialsCacheEntryHints(object):
143143

144144
@attr.s(hash=False)
145145
class CryptoMaterialsCacheEntry(object):
146+
# pylint: disable=too-many-instance-attributes
146147
"""Value and metadata store for cryptographic materials cache entries.
147148
148149
:param bytes cache_key: Identifier for entries in cache

src/aws_encryption_sdk/streaming_client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def read(self, b=-1):
235235
if not self._message_prepped:
236236
self._prep_message()
237237

238-
if self.closed:
238+
if self.closed: # dynamic values confuse pylint: disable=using-constant-test
239239
raise ValueError("I/O operation on closed file")
240240

241241
if b >= 0:
@@ -283,7 +283,7 @@ def readline(self):
283283

284284
def readlines(self):
285285
"""Reads all chunks of output, outputting a list as defined in the IOBase specification."""
286-
return [line for line in self]
286+
return list(self)
287287

288288
def __iter__(self):
289289
"""Make this class and subclasses identify as iterators."""
@@ -292,7 +292,7 @@ def __iter__(self):
292292
def next(self):
293293
"""Provides hook for Python2 iterator functionality."""
294294
_LOGGER.debug("reading next")
295-
if self.closed:
295+
if self.closed: # dynamic values confuse pylint: disable=using-constant-test
296296
_LOGGER.debug("stream is closed")
297297
raise StopIteration()
298298

src/aws_encryption_sdk/structures.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
@attr.s(hash=True)
2222
class MessageHeader(object):
23+
# pylint: disable=too-many-instance-attributes
2324
"""Deserialized message header object.
2425
2526
:param version: Message format version, per spec

test/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mock
22
pytest>=3.3.1
33
pytest-cov
4-
pytest-mock
4+
pytest-mock

test/unit/test_identifiers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_algorithm_safe_to_cache(check_algorithm, safe_to_cache):
4141
assert not check_algorithm.safe_to_cache()
4242

4343

44-
@pytest.mark.parametrize("suite", [suite for suite in EncryptionSuite])
44+
@pytest.mark.parametrize("suite", list(EncryptionSuite))
4545
def test_encryption_suite_invalid_kdf(suite):
4646
mock_kdf = Mock()
4747
mock_kdf.input_length.return_value = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
aws-encryption-sdk==1.3.3
2+
attrs<19.2.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aws-encryption-sdk >= 1.3.3, < 1.4.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aws-encryption-sdk

test_vector_handlers/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
attrs >= 17.4.0
22
aws-encryption-sdk
3-
six
3+
six

test_vector_handlers/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_version():
2222
def get_requirements():
2323
"""Read the requirements file."""
2424
requirements = read("requirements.txt")
25-
return [r for r in requirements.strip().splitlines()]
25+
return list(requirements.strip().splitlines())
2626

2727

2828
setup(
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mock
22
pytest>=3.3.1
33
pytest-cov
4-
pytest-mock
4+
pytest-mock

test_vector_handlers/tox.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ passenv =
4646
sitepackages = False
4747
deps =
4848
-rtest/requirements.txt
49-
awses_1.3.3: aws-encryption-sdk==1.3.3
50-
awses_1.3.max: aws-encryption-sdk >= 1.3.3, < 1.4.0
51-
awses_latest: aws-encryption-sdk
49+
awses_1.3.3: -rcompatibility-requirements/1.3.3
50+
awses_1.3.max: -rcompatibility-requirements/1.3.max
51+
awses_latest: -rcompatibility-requirements/latest
5252
commands = {[testenv:base-command]commands}
5353

5454
[testenv:full-encrypt]

0 commit comments

Comments
 (0)