Skip to content

chore: Fix broken CI #441

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 7 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
61 changes: 0 additions & 61 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,6 @@ on:
- cron: '0 0 * * *'

jobs:
# Hypothesis no longer supports Python 2 and
# there is a bug that appears with our slow tests
# only on Python 2.
# Until we also drop Python 2 support,
# the workaround is just that we don't run the slow tests
# on Python 2.
py2-tests:
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: true
matrix:
platform:
- os: ubuntu-latest
architecture: x64
- os: windows-latest
architecture: x64
# x86 builds are only meaningful for Windows
- os: windows-latest
architecture: x86
- os: macos-latest
architecture: x64
category:
- local-fast
# These require credentials.
# Enable them once we sort how to provide them.
# - integ-fast
# - examples
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 2.7
architecture: ${{ matrix.platform.architecture }}
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
run: tox -- -vv
tests:
runs-on: ${{ matrix.platform.os }}
strategy:
Expand All @@ -65,8 +25,6 @@ jobs:
- os: macos-latest
architecture: x64
python:
- 3.5
- 3.6
- 3.7
- 3.8
- 3.x
Expand Down Expand Up @@ -110,22 +68,3 @@ jobs:
env:
TOXENV: ${{ matrix.category }}
run: tox -- -vv
upstream-py2:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
category:
- test-upstream-requirements-py27
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 2.7
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
run: tox -- -vv
6 changes: 0 additions & 6 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ version: 0.2
batch:
fast-fail: false
build-list:
- identifier: python2_7
buildspec: codebuild/python2.7.yml
- identifier: python3_5
buildspec: codebuild/python3.5.yml
- identifier: python3_6
buildspec: codebuild/python3.6.yml
- identifier: python3_7
buildspec: codebuild/python3.7.yml
- identifier: python3_8
Expand Down
18 changes: 0 additions & 18 deletions codebuild/python2.7.yml

This file was deleted.

32 changes: 0 additions & 32 deletions codebuild/python3.5.yml

This file was deleted.

18 changes: 0 additions & 18 deletions codebuild/python3.6.yml

This file was deleted.

4 changes: 3 additions & 1 deletion codebuild/python3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ phases:
python: latest
build:
commands:
- pip install tox
- pyenv install 3.8.6
- pyenv local 3.8.6
- pip install tox tox-pyenv
- tox
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_version():
return _release


project = u"dynamodb-encryption-sdk-python"
project = "dynamodb-encryption-sdk-python"
version = get_version()
release = get_release()

Expand All @@ -53,7 +53,7 @@ def get_version():
source_suffix = ".rst" # The suffix of source filenames.
master_doc = "index" # The master toctree document.

copyright = u"%s, Amazon" % datetime.now().year # pylint: disable=redefined-builtin
copyright = "%s, Amazon" % datetime.now().year # pylint: disable=redefined-builtin

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
Expand Down
4 changes: 2 additions & 2 deletions examples/src/aws_kms_encrypted_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ def encrypt_batch_items(table_name, aws_cmk_id):
def _select_index_from_item(item):
"""Find the index keys that match this item."""
for index in index_keys:
if all([item[key] == value for key, value in index.items()]):
if all(item[key] == value for key, value in index.items()):
return index

raise Exception("Index key not found in item.")

def _select_item_from_index(index, all_items):
"""Find the item that matches these index keys."""
for item in all_items:
if all([item[key] == value for key, value in index.items()]):
if all(item[key] == value for key, value in index.items()):
return item

raise Exception("Index key not found in item.")
Expand Down
4 changes: 2 additions & 2 deletions examples/src/aws_kms_encrypted_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def encrypt_batch_items(table_name, aws_cmk_id):
def _select_index_from_item(item):
"""Find the index keys that match this item."""
for index in index_keys:
if all([item[key] == value for key, value in index.items()]):
if all(item[key] == value for key, value in index.items()):
return index

raise Exception("Index key not found in item.")

def _select_item_from_index(index, all_items):
"""Find the item that matches these index keys."""
for item in all_items:
if all([item[key] == value for key, value in index.items()]):
if all(item[key] == value for key, value in index.items()):
return item

raise Exception("Index key not found in item.")
Expand Down
1 change: 1 addition & 0 deletions examples/src/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
disable =
duplicate-code, # these examples often feature similar code
too-many-locals, # for these examples, we prioritize keeping everything together for simple readability
consider-using-f-string, # Not supported in Python 3.5

[BASIC]
# Allow function names up to 50 characters
Expand Down
1 change: 1 addition & 0 deletions examples/test/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ disable =
# pylint does not recognize this
duplicate-code, # tests for similar things tend to be similar
redefined-outer-name, # raises false positives with fixtures
consider-using-f-string, # Not supported in Python 3.5

[DESIGN]
max-args = 10
Expand Down
3 changes: 2 additions & 1 deletion src/dynamodb_encryption_sdk/delegated_keys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class DelegatedKey(object):
a :class:`NotImplementedError` detailing this.
"""

@abc.abstractproperty
@property
@abc.abstractmethod
def algorithm(self):
# type: () -> Text
"""Text description of algorithm used by this delegated key."""
Expand Down
4 changes: 2 additions & 2 deletions src/dynamodb_encryption_sdk/material_providers/most_recent.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def _get_provider_with_grace_period(self, version, ttl_action):
:raises AttributeError: if provider could not locate version
"""
blocking_wait = bool(ttl_action is TtlActions.EXPIRED)
acquired = self._lock.acquire(blocking_wait)
acquired = self._lock.acquire(blocking_wait) # pylint: disable=consider-using-with
if not acquired:
# We failed to acquire the lock.
# If blocking, we will never reach this point.
Expand Down Expand Up @@ -310,7 +310,7 @@ def _get_most_recent_version(self, ttl_action):
:rtype: CryptographicMaterialsProvider
"""
blocking_wait = bool(ttl_action is TtlActions.EXPIRED)
acquired = self._lock.acquire(blocking_wait)
acquired = self._lock.acquire(blocking_wait) # pylint: disable=consider-using-with

if not acquired:
# We failed to acquire the lock.
Expand Down
15 changes: 10 additions & 5 deletions src/dynamodb_encryption_sdk/materials/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
class CryptographicMaterials(object):
"""Base class for all cryptographic materials."""

@abc.abstractproperty
@property
@abc.abstractmethod
def material_description(self):
# type: () -> Dict[Text, Text]
"""Material description to use with these cryptographic materials.
Expand All @@ -42,7 +43,8 @@ def material_description(self):
:rtype: dict
"""

@abc.abstractproperty
@property
@abc.abstractmethod
def encryption_key(self):
# type: () -> DelegatedKey
"""Delegated key used for encrypting attributes.
Expand All @@ -51,7 +53,8 @@ def encryption_key(self):
:rtype: DelegatedKey
"""

@abc.abstractproperty
@property
@abc.abstractmethod
def decryption_key(self):
# type: () -> DelegatedKey
"""Delegated key used for decrypting attributes.
Expand All @@ -60,7 +63,8 @@ def decryption_key(self):
:rtype: DelegatedKey
"""

@abc.abstractproperty
@property
@abc.abstractmethod
def signing_key(self):
# type: () -> DelegatedKey
"""Delegated key used for calculating digital signatures.
Expand All @@ -69,7 +73,8 @@ def signing_key(self):
:rtype: DelegatedKey
"""

@abc.abstractproperty
@property
@abc.abstractmethod
def verification_key(self):
# type: () -> DelegatedKey
"""Delegated key used for verifying digital signatures.
Expand Down
2 changes: 1 addition & 1 deletion src/pylintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[MESSAGES CONTROL]
# Disabling messages that we either don't care about for tests or are necessary to break for tests.
disable =
bad-continuation, # we let black handle this
ungrouped-imports, # we let isort handle this
duplicate-code, # causes lots of problems with implementations of common interfaces
# All below are disabled because we need to support Python 2
useless-object-inheritance,
raise-missing-from,
super-with-arguments,
consider-using-f-string,

[BASIC]
# Allow function names up to 50 characters
Expand Down
6 changes: 3 additions & 3 deletions test/acceptance/acceptance_test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def load_scenarios(online):
into a shared method.
"""
# pylint: disable=too-many-locals
with open(_SCENARIO_FILE) as f:
with open(_SCENARIO_FILE, encoding="utf-8") as f:
scenarios = json.load(f)
keys_file = _filename_from_uri(scenarios["keys"])
keys = _load_keys(keys_file)
Expand Down Expand Up @@ -128,7 +128,7 @@ def _generate(materials_provider, table_data, ciphertext_file, metastore_info):
if table:
table.delete()

with open(ciphertext_file, "w") as outfile:
with open(ciphertext_file, "w", encoding="utf-8") as outfile:
json.dump(data_table_output, outfile, indent=4)

if metatable:
Expand All @@ -137,7 +137,7 @@ def _generate(materials_provider, table_data, ciphertext_file, metastore_info):
metastore_output[metastore_info["table_name"]].append(ddb_to_json(wrapping_key))

metastore_ciphertext_file = _filename_from_uri(metastore_info["ciphertext"])
with open(metastore_ciphertext_file, "w") as outfile:
with open(metastore_ciphertext_file, "w", encoding="utf-8") as outfile:
json.dump(metastore_output, outfile, indent=4)

metatable.delete()
Expand Down
Loading