Skip to content

Commit b40745d

Browse files
chore: Fix broken CI (#179)
1 parent 421b551 commit b40745d

File tree

7 files changed

+21
-19
lines changed

7 files changed

+21
-19
lines changed

codebuild/python3.8.yml

Lines changed: 3 additions & 1 deletion
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

doc/conf.py

Lines changed: 2 additions & 2 deletions
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.

test/acceptance/acceptance_test_generators.py

Lines changed: 3 additions & 3 deletions
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()

test/acceptance/acceptance_test_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _decode_item(item):
6161

6262
def _build_plaintext_items(plaintext_file, version):
6363
# pylint: disable=too-many-locals
64-
with open(plaintext_file) as f:
64+
with open(plaintext_file, encoding="utf-8") as f:
6565
plaintext_data = json.load(f)
6666

6767
actions = {}
@@ -92,7 +92,7 @@ def _build_plaintext_items(plaintext_file, version):
9292

9393

9494
def _load_ciphertext_items(ciphertext_file):
95-
with open(ciphertext_file) as f:
95+
with open(ciphertext_file, encoding="utf-8") as f:
9696
ciphertexts = json.load(f)
9797

9898
for _table, items in ciphertexts.items():
@@ -103,7 +103,7 @@ def _load_ciphertext_items(ciphertext_file):
103103

104104

105105
def _load_keys(keys_file):
106-
with open(keys_file) as f:
106+
with open(keys_file, encoding="utf-8") as f:
107107
return json.load(f)
108108

109109

@@ -165,7 +165,7 @@ def _meta_table_prep(table_name, items_filename):
165165
table = boto3.resource("dynamodb", region_name="us-west-2").Table(table_name)
166166
table.wait_until_exists()
167167
try:
168-
with open(_filename_from_uri(items_filename)) as f:
168+
with open(_filename_from_uri(items_filename), encoding="utf-8") as f:
169169
table_data = json.load(f)
170170
request_items = {}
171171

@@ -255,7 +255,7 @@ def _expand_items(ciphertext_items, plaintext_items):
255255

256256
def load_scenarios(online):
257257
# pylint: disable=too-many-locals
258-
with open(_SCENARIO_FILE) as f:
258+
with open(_SCENARIO_FILE, encoding="utf-8") as f:
259259
scenarios = json.load(f)
260260
keys_file = _filename_from_uri(scenarios["keys"])
261261
keys = _load_keys(keys_file)

test/functional/functional_test_vector_generators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ def _decode_complex_value(_value):
104104

105105
def attribute_test_vectors(mode):
106106
filepath = _ATTRIBUTE_TEST_VECTOR_FILE_TEMPLATE.format(mode=mode)
107-
with open(filepath) as f:
107+
with open(filepath, encoding="utf-8") as f:
108108
vectors = json.load(f)
109109
for vector in vectors:
110110
yield (decode_value(vector["attribute"]), base64.b64decode(codecs.encode(vector["serialized"], "utf-8")))
111111

112112

113113
def material_description_test_vectors():
114-
with open(_MATERIAL_DESCRIPTION_TEST_VECTORS_FILE) as f:
114+
with open(_MATERIAL_DESCRIPTION_TEST_VECTORS_FILE, encoding="utf-8") as f:
115115
vectors = json.load(f)
116116
for vector in vectors:
117117
yield (vector["material_description"], decode_value({"B": codecs.encode(vector["serialized"], "utf-8")}))
@@ -125,7 +125,7 @@ def material_description_test_vectors():
125125

126126

127127
def string_to_sign_test_vectors():
128-
with open(_STRING_TO_SIGN_TEST_VECTORS_FILE) as f:
128+
with open(_STRING_TO_SIGN_TEST_VECTORS_FILE, encoding="utf-8") as f:
129129
vectors = json.load(f)
130130
for vector in vectors:
131131
item = {key: decode_value(value["value"]) for key, value in vector["item"].items()}

test/functional/internal/test_str_ops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
(
2727
("asdf", "asdf"),
2828
(b"asdf", "asdf"),
29-
(codecs.encode(u"Предисловие", "utf-8"), u"Предисловие"),
30-
(u"Предисловие", u"Предисловие"),
29+
(codecs.encode("Предисловие", "utf-8"), "Предисловие"),
30+
("Предисловие", "Предисловие"),
3131
),
3232
)
3333
def test_to_str(data, expected_output):
@@ -41,8 +41,8 @@ def test_to_str(data, expected_output):
4141
("asdf", b"asdf"),
4242
(b"asdf", b"asdf"),
4343
(b"\x3a\x00\x99", b"\x3a\x00\x99"),
44-
(u"Предисловие", codecs.encode(u"Предисловие", "utf-8")),
45-
(codecs.encode(u"Предисловие", "utf-8"), codecs.encode(u"Предисловие", "utf-8")),
44+
("Предисловие", codecs.encode("Предисловие", "utf-8")),
45+
(codecs.encode("Предисловие", "utf-8"), codecs.encode("Предисловие", "utf-8")),
4646
),
4747
)
4848
def test_to_bytes(data, expected_output):

test/unit/material_providers/test_aws_kms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_loaded_key_infos():
225225
[
226226
pytest.param(val, id=str(val))
227227
for val in all_possible_combinations_kwargs(
228-
dict(),
228+
{},
229229
dict(botocore_session=botocore.session.Session()),
230230
dict(grant_tokens=("sdvoaweih", "auwshefiouawh")),
231231
dict(material_description={"asoiufeoia": "soajfijewi"}),

0 commit comments

Comments
 (0)