Skip to content

Commit

Permalink
Update to pyyaml 5.1 (#690)
Browse files Browse the repository at this point in the history
* update to pyyaml 5.1

* mypy
  • Loading branch information
fhieber authored May 6, 2019
1 parent 5d64a1e commit 2d458b2
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Note that Sockeye has checks in place to not translate with an old model that wa

Each version section may have have subsections for: _Added_, _Changed_, _Removed_, _Deprecated_, and _Fixed_.

## [1.18.97]
### Changed
- Updated to PyYAML 5.1

## [1.18.96]
### Changed
- Extracted prepare vocab functionality in the build vocab step into its own function. This matches the pattern in prepare data and train where the main() function only has argparsing, and it invokes a separate function to do the work. This is to allow modules that import this one to circumvent the command line.
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ sphinx>=1.7.4
sphinx_rtd_theme
sphinx-autodoc-typehints>=1.3.0
recommonmark
pyyaml==3.12
pyyaml>=5.1
2 changes: 1 addition & 1 deletion requirements/requirements.gpu-cu100.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyyaml==3.12
pyyaml>=5.1
mxnet-cu100mkl==1.4.0
numpy>=1.14
typing
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.gpu-cu80.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyyaml==3.12
pyyaml>=5.1
mxnet-cu80mkl==1.4.0
numpy>=1.14
typing
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.gpu-cu90.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyyaml==3.12
pyyaml>=5.1
mxnet-cu90mkl==1.4.0
numpy>=1.14
typing
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.gpu-cu92.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyyaml==3.12
pyyaml>=5.1
mxnet-cu92mkl==1.4.0
numpy>=1.14
typing
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyyaml==3.12
pyyaml>=5.1
mxnet-mkl==1.4.0
numpy>=1.14
typing
Expand Down
2 changes: 1 addition & 1 deletion sockeye/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

__version__ = '1.18.96'
__version__ = '1.18.97'
4 changes: 3 additions & 1 deletion sockeye/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Config(yaml.YAMLObject, metaclass=TaggedYamlObjectMetaclass):
Base configuration object that supports freezing of members and YAML (de-)serialization.
Actual Configuration should subclass this object.
"""
yaml_loader = yaml.UnsafeLoader # type: ignore

def __init__(self):
self.__add_frozen()

Expand Down Expand Up @@ -119,7 +121,7 @@ def load(fname: str) -> 'Config':
:return: Configuration.
"""
with open(fname) as inp:
obj = yaml.load(inp)
obj = yaml.load(inp, Loader=yaml.UnsafeLoader) # type: ignore
obj.__add_frozen()
return obj

Expand Down

0 comments on commit 2d458b2

Please sign in to comment.