Skip to content

Commit 11dffda

Browse files
author
thomas
authored
Merge pull request #9 from pypyr/dev
ruamel.yaml upgrade to >0.15
2 parents 961620e + 5e63552 commit 11dffda

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
.pytest_cache/
56

67
# C extensions
78
*.so

pypyraws/steps/s3fetchyaml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def run_step(context):
2525
logger.debug("started")
2626
response = pypyraws.aws.s3.get_payload(context)
2727

28-
payload = yaml.safe_load(response)
28+
yaml_loader = yaml.YAML(typ='safe', pure=True)
29+
payload = yaml_loader.load(response)
2930
logger.debug("successfully parsed yaml from s3 response bytes")
3031
context.update(payload)
3132
logger.info("loaded s3 yaml into pypyr context")

pypyraws/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import platform
44

5-
__version__ = '0.0.4'
5+
__version__ = '0.1.0'
66

77

88
def get_version():

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.0.4
2+
current_version = 0.1.0
33

44
[bdist_wheel]
55
universal = 0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
# your project is installed. For an analysis of "install_requires" vs pip's
7979
# requirements files see:
8080
# https://packaging.python.org/en/latest/requirements.html
81-
install_requires=['pypyr', 'boto3', 'ruamel.yaml<0.15'],
81+
install_requires=['pypyr', 'boto3', 'ruamel.yaml'],
8282

8383
# List additional groups of dependencies here (e.g. development
8484
# dependencies). You can install these using the following syntax,

tests/unit/pypyraws/steps/s3fetchyaml_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""s3fetchyaml.py unit tests."""
2+
import io
23
import pypyraws.steps.s3fetchyaml # as s3fetchyaml
34
from pypyr.context import Context
45
import ruamel.yaml as yaml
@@ -9,9 +10,10 @@
910
def test_s3fetchyaml(mock_s3):
1011
"""Success path all the way through to the mocked boto s3 object."""
1112
input_dict = {'newkey': 'newvalue', 'newkey2': 'newvalue2'}
12-
string_of_yaml = yaml.dump(input_dict, Dumper=yaml.RoundTripDumper)
13-
bunch_of_bytes = bytes(string_of_yaml, 'utf-8')
14-
mock_s3.side_effect = [{'Body': bunch_of_bytes}]
13+
yaml_loader = yaml.YAML()
14+
string_stream = io.StringIO()
15+
yaml_loader.dump(input_dict, string_stream)
16+
mock_s3.side_effect = [{'Body': string_stream.getvalue()}]
1517

1618
context = Context({
1719
'k1': 'v1',

0 commit comments

Comments
 (0)