Skip to content

Updates to handle new pylint requirements #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion decrypt_oracle/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_version():
def get_requirements():
"""Read the requirements file."""
requirements = read("requirements-actual.txt")
return [r for r in requirements.strip().splitlines()]
return list(requirements.strip().splitlines())


setup(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_version():
def get_requirements():
"""Reads the requirements file."""
requirements = read("requirements.txt")
return [r for r in requirements.strip().splitlines()]
return list(requirements.strip().splitlines())


setup(
Expand Down
1 change: 1 addition & 0 deletions src/aws_encryption_sdk/caches/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class CryptoMaterialsCacheEntryHints(object):

@attr.s(hash=False)
class CryptoMaterialsCacheEntry(object):
# pylint: disable=too-many-instance-attributes
"""Value and metadata store for cryptographic materials cache entries.
:param bytes cache_key: Identifier for entries in cache
Expand Down
6 changes: 3 additions & 3 deletions src/aws_encryption_sdk/streaming_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def read(self, b=-1):
if not self._message_prepped:
self._prep_message()

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

if b >= 0:
Expand Down Expand Up @@ -283,7 +283,7 @@ def readline(self):

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

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

Expand Down
1 change: 1 addition & 0 deletions src/aws_encryption_sdk/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

@attr.s(hash=True)
class MessageHeader(object):
# pylint: disable=too-many-instance-attributes
"""Deserialized message header object.

:param version: Message format version, per spec
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_algorithm_safe_to_cache(check_algorithm, safe_to_cache):
assert not check_algorithm.safe_to_cache()


@pytest.mark.parametrize("suite", [suite for suite in EncryptionSuite])
@pytest.mark.parametrize("suite", list(EncryptionSuite))
def test_encryption_suite_invalid_kdf(suite):
mock_kdf = Mock()
mock_kdf.input_length.return_value = 1
Expand Down
2 changes: 2 additions & 0 deletions test_vector_handlers/compatibility-requirements/1.3.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
aws-encryption-sdk==1.3.3
attrs<19.2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we add a version for attrs here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bah...didn't expand the comment :(

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.

1 change: 1 addition & 0 deletions test_vector_handlers/compatibility-requirements/1.3.max
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aws-encryption-sdk >= 1.3.3, < 1.4.0
1 change: 1 addition & 0 deletions test_vector_handlers/compatibility-requirements/latest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aws-encryption-sdk
2 changes: 1 addition & 1 deletion test_vector_handlers/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_version():
def get_requirements():
"""Read the requirements file."""
requirements = read("requirements.txt")
return [r for r in requirements.strip().splitlines()]
return list(requirements.strip().splitlines())


setup(
Expand Down
6 changes: 3 additions & 3 deletions test_vector_handlers/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ passenv =
sitepackages = False
deps =
-rtest/requirements.txt
awses_1.3.3: aws-encryption-sdk==1.3.3
awses_1.3.max: aws-encryption-sdk >= 1.3.3, < 1.4.0
awses_latest: aws-encryption-sdk
awses_1.3.3: -rcompatibility-requirements/1.3.3
awses_1.3.max: -rcompatibility-requirements/1.3.max
awses_latest: -rcompatibility-requirements/latest
commands = {[testenv:base-command]commands}

[testenv:full-encrypt]
Expand Down