Skip to content

Commit b55e8ed

Browse files
authored
chore: Fix broken CI (#441)
1 parent 90606ec commit b55e8ed

25 files changed

+95
-269
lines changed

Diff for: .github/workflows/ci_tests.yaml

-61
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,6 @@ on:
99
- cron: '0 0 * * *'
1010

1111
jobs:
12-
# Hypothesis no longer supports Python 2 and
13-
# there is a bug that appears with our slow tests
14-
# only on Python 2.
15-
# Until we also drop Python 2 support,
16-
# the workaround is just that we don't run the slow tests
17-
# on Python 2.
18-
py2-tests:
19-
runs-on: ${{ matrix.platform.os }}
20-
strategy:
21-
fail-fast: true
22-
matrix:
23-
platform:
24-
- os: ubuntu-latest
25-
architecture: x64
26-
- os: windows-latest
27-
architecture: x64
28-
# x86 builds are only meaningful for Windows
29-
- os: windows-latest
30-
architecture: x86
31-
- os: macos-latest
32-
architecture: x64
33-
category:
34-
- local-fast
35-
# These require credentials.
36-
# Enable them once we sort how to provide them.
37-
# - integ-fast
38-
# - examples
39-
steps:
40-
- uses: actions/checkout@v2
41-
- uses: actions/setup-python@v1
42-
with:
43-
python-version: 2.7
44-
architecture: ${{ matrix.platform.architecture }}
45-
- run: |
46-
python -m pip install --upgrade pip
47-
pip install --upgrade -r ci-requirements.txt
48-
- name: run test
49-
env:
50-
TOXENV: ${{ matrix.category }}
51-
run: tox -- -vv
5212
tests:
5313
runs-on: ${{ matrix.platform.os }}
5414
strategy:
@@ -65,8 +25,6 @@ jobs:
6525
- os: macos-latest
6626
architecture: x64
6727
python:
68-
- 3.5
69-
- 3.6
7028
- 3.7
7129
- 3.8
7230
- 3.x
@@ -110,22 +68,3 @@ jobs:
11068
env:
11169
TOXENV: ${{ matrix.category }}
11270
run: tox -- -vv
113-
upstream-py2:
114-
runs-on: ubuntu-latest
115-
strategy:
116-
fail-fast: true
117-
matrix:
118-
category:
119-
- test-upstream-requirements-py27
120-
steps:
121-
- uses: actions/checkout@v2
122-
- uses: actions/setup-python@v1
123-
with:
124-
python-version: 2.7
125-
- run: |
126-
python -m pip install --upgrade pip
127-
pip install --upgrade -r ci-requirements.txt
128-
- name: run test
129-
env:
130-
TOXENV: ${{ matrix.category }}
131-
run: tox -- -vv

Diff for: buildspec.yml

-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ version: 0.2
33
batch:
44
fast-fail: false
55
build-list:
6-
- identifier: python2_7
7-
buildspec: codebuild/python2.7.yml
8-
- identifier: python3_5
9-
buildspec: codebuild/python3.5.yml
10-
- identifier: python3_6
11-
buildspec: codebuild/python3.6.yml
126
- identifier: python3_7
137
buildspec: codebuild/python3.7.yml
148
- identifier: python3_8

Diff for: codebuild/python2.7.yml

-18
This file was deleted.

Diff for: codebuild/python3.5.yml

-32
This file was deleted.

Diff for: codebuild/python3.6.yml

-18
This file was deleted.

Diff for: codebuild/python3.8.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ phases:
1414
python: latest
1515
build:
1616
commands:
17-
- pip install tox
17+
- pyenv install 3.8.6
18+
- pyenv local 3.8.6
19+
- pip install tox tox-pyenv
1820
- tox

Diff for: doc/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_version():
2929
return _release
3030

3131

32-
project = u"dynamodb-encryption-sdk-python"
32+
project = "dynamodb-encryption-sdk-python"
3333
version = get_version()
3434
release = get_release()
3535

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

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

5858
# List of directories, relative to source directory, that shouldn't be searched
5959
# for source files.

Diff for: examples/src/aws_kms_encrypted_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ def encrypt_batch_items(table_name, aws_cmk_id):
124124
def _select_index_from_item(item):
125125
"""Find the index keys that match this item."""
126126
for index in index_keys:
127-
if all([item[key] == value for key, value in index.items()]):
127+
if all(item[key] == value for key, value in index.items()):
128128
return index
129129

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

132132
def _select_item_from_index(index, all_items):
133133
"""Find the item that matches these index keys."""
134134
for item in all_items:
135-
if all([item[key] == value for key, value in index.items()]):
135+
if all(item[key] == value for key, value in index.items()):
136136
return item
137137

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

Diff for: examples/src/aws_kms_encrypted_resource.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ def encrypt_batch_items(table_name, aws_cmk_id):
7676
def _select_index_from_item(item):
7777
"""Find the index keys that match this item."""
7878
for index in index_keys:
79-
if all([item[key] == value for key, value in index.items()]):
79+
if all(item[key] == value for key, value in index.items()):
8080
return index
8181

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

8484
def _select_item_from_index(index, all_items):
8585
"""Find the item that matches these index keys."""
8686
for item in all_items:
87-
if all([item[key] == value for key, value in index.items()]):
87+
if all(item[key] == value for key, value in index.items()):
8888
return item
8989

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

Diff for: examples/src/pylintrc

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
disable =
44
duplicate-code, # these examples often feature similar code
55
too-many-locals, # for these examples, we prioritize keeping everything together for simple readability
6+
consider-using-f-string, # Not supported in Python 3.5
67

78
[BASIC]
89
# Allow function names up to 50 characters

Diff for: examples/test/pylintrc

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ disable =
1010
# pylint does not recognize this
1111
duplicate-code, # tests for similar things tend to be similar
1212
redefined-outer-name, # raises false positives with fixtures
13+
consider-using-f-string, # Not supported in Python 3.5
1314

1415
[DESIGN]
1516
max-args = 10

Diff for: src/dynamodb_encryption_sdk/delegated_keys/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class DelegatedKey(object):
4545
a :class:`NotImplementedError` detailing this.
4646
"""
4747

48-
@abc.abstractproperty
48+
@property
49+
@abc.abstractmethod
4950
def algorithm(self):
5051
# type: () -> Text
5152
"""Text description of algorithm used by this delegated key."""

Diff for: src/dynamodb_encryption_sdk/material_providers/most_recent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _get_provider_with_grace_period(self, version, ttl_action):
272272
:raises AttributeError: if provider could not locate version
273273
"""
274274
blocking_wait = bool(ttl_action is TtlActions.EXPIRED)
275-
acquired = self._lock.acquire(blocking_wait)
275+
acquired = self._lock.acquire(blocking_wait) # pylint: disable=consider-using-with
276276
if not acquired:
277277
# We failed to acquire the lock.
278278
# If blocking, we will never reach this point.
@@ -310,7 +310,7 @@ def _get_most_recent_version(self, ttl_action):
310310
:rtype: CryptographicMaterialsProvider
311311
"""
312312
blocking_wait = bool(ttl_action is TtlActions.EXPIRED)
313-
acquired = self._lock.acquire(blocking_wait)
313+
acquired = self._lock.acquire(blocking_wait) # pylint: disable=consider-using-with
314314

315315
if not acquired:
316316
# We failed to acquire the lock.

Diff for: src/dynamodb_encryption_sdk/materials/__init__.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
class CryptographicMaterials(object):
3434
"""Base class for all cryptographic materials."""
3535

36-
@abc.abstractproperty
36+
@property
37+
@abc.abstractmethod
3738
def material_description(self):
3839
# type: () -> Dict[Text, Text]
3940
"""Material description to use with these cryptographic materials.
@@ -42,7 +43,8 @@ def material_description(self):
4243
:rtype: dict
4344
"""
4445

45-
@abc.abstractproperty
46+
@property
47+
@abc.abstractmethod
4648
def encryption_key(self):
4749
# type: () -> DelegatedKey
4850
"""Delegated key used for encrypting attributes.
@@ -51,7 +53,8 @@ def encryption_key(self):
5153
:rtype: DelegatedKey
5254
"""
5355

54-
@abc.abstractproperty
56+
@property
57+
@abc.abstractmethod
5558
def decryption_key(self):
5659
# type: () -> DelegatedKey
5760
"""Delegated key used for decrypting attributes.
@@ -60,7 +63,8 @@ def decryption_key(self):
6063
:rtype: DelegatedKey
6164
"""
6265

63-
@abc.abstractproperty
66+
@property
67+
@abc.abstractmethod
6468
def signing_key(self):
6569
# type: () -> DelegatedKey
6670
"""Delegated key used for calculating digital signatures.
@@ -69,7 +73,8 @@ def signing_key(self):
6973
:rtype: DelegatedKey
7074
"""
7175

72-
@abc.abstractproperty
76+
@property
77+
@abc.abstractmethod
7378
def verification_key(self):
7479
# type: () -> DelegatedKey
7580
"""Delegated key used for verifying digital signatures.

Diff for: src/pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[MESSAGES CONTROL]
22
# Disabling messages that we either don't care about for tests or are necessary to break for tests.
33
disable =
4-
bad-continuation, # we let black handle this
54
ungrouped-imports, # we let isort handle this
65
duplicate-code, # causes lots of problems with implementations of common interfaces
76
# All below are disabled because we need to support Python 2
87
useless-object-inheritance,
98
raise-missing-from,
109
super-with-arguments,
10+
consider-using-f-string,
1111

1212
[BASIC]
1313
# Allow function names up to 50 characters

Diff for: test/acceptance/acceptance_test_generators.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def load_scenarios(online):
4343
into a shared method.
4444
"""
4545
# pylint: disable=too-many-locals
46-
with open(_SCENARIO_FILE) as f:
46+
with open(_SCENARIO_FILE, encoding="utf-8") as f:
4747
scenarios = json.load(f)
4848
keys_file = _filename_from_uri(scenarios["keys"])
4949
keys = _load_keys(keys_file)
@@ -128,7 +128,7 @@ def _generate(materials_provider, table_data, ciphertext_file, metastore_info):
128128
if table:
129129
table.delete()
130130

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

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

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

143143
metatable.delete()

0 commit comments

Comments
 (0)