diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | README.rst | 11 | ||||
-rw-r--r-- | __init__.py | 6 | ||||
-rw-r--r-- | _doc/_static/pypi.svg | 2 | ||||
-rw-r--r-- | comments.py | 4 | ||||
-rw-r--r-- | emitter.py | 10 | ||||
-rw-r--r-- | representer.py | 1 | ||||
-rw-r--r-- | util.py | 1 |
8 files changed, 23 insertions, 15 deletions
@@ -1,3 +1,6 @@ +[0, 17, 19]: 2021-12-26 + - fix mypy problems (reported by `Arun <https://sourceforge.net/u/arunppsg/profile/>`__) + [0, 17, 18]: 2021-12-24 - copy-paste error in folded scalar comment attachment (reported by `Stephan Geulette <https://sourceforge.net/u/sgeulette/profile/>`__) @@ -4,8 +4,8 @@ ruamel.yaml ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python. -:version: 0.17.18 -:updated: 2021-12-24 +:version: 0.17.19 +:updated: 2021-12-26 :documentation: http://yaml.readthedocs.io :repository: https://sourceforge.net/projects/ruamel-yaml/ :pypi: https://pypi.org/project/ruamel.yaml/ @@ -55,10 +55,10 @@ when the status of the API is stable enough to make the transition. .. image:: https://bestpractices.coreinfrastructure.org/projects/1128/badge :target: https://bestpractices.coreinfrastructure.org/projects/1128 -.. image:: https://sourceforge.net/p/ruamel-yaml-base/code/ci/default/tree/_doc/_static/license.svg?format=raw +.. image:: https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/license.svg?format=raw :target: https://opensource.org/licenses/MIT -.. image:: https://sourceforge.net/p/ruamel-yaml-base/code/ci/default/tree/_doc/_static/pypi.svg?format=raw +.. image:: https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/pypi.svg?format=raw :target: https://pypi.org/project/ruamel.yaml/ .. image:: https://sourceforge.net/p/oitnb/code/ci/default/tree/_doc/_static/oitnb.svg?format=raw @@ -72,6 +72,9 @@ ChangeLog .. should insert NEXT: at the beginning of line for next key (with empty line) +0.17.19 (2021-12-26): + - fix mypy problems (reported by `Arun <https://sourceforge.net/u/arunppsg/profile/>`__) + 0.17.18 (2021-12-24): - copy-paste error in folded scalar comment attachment (reported by `Stephan Geulette <https://sourceforge.net/u/sgeulette/profile/>`__) diff --git a/__init__.py b/__init__.py index f7d767a..3666b0b 100644 --- a/__init__.py +++ b/__init__.py @@ -5,9 +5,9 @@ if False: # MYPY _package_data = dict( full_package_name='ruamel.yaml', - version_info=(0, 17, 18), - __version__='0.17.18', - version_timestamp='2021-12-24 14:28:35', + version_info=(0, 17, 19), + __version__='0.17.19', + version_timestamp='2021-12-26 16:02:42', author='Anthon van der Neut', author_email='a.van.der.neut@ruamel.eu', description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA diff --git a/_doc/_static/pypi.svg b/_doc/_static/pypi.svg index ca071d2..cd5be20 100644 --- a/_doc/_static/pypi.svg +++ b/_doc/_static/pypi.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.17.18</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.17.18</text></g> </svg> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.17.19</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.17.19</text></g> </svg> diff --git a/comments.py b/comments.py index 11ee8ad..892c868 100644 --- a/comments.py +++ b/comments.py @@ -395,10 +395,10 @@ class CommentedBase: if c[1] is None: c[1] = [] if before == '\n': - c[1].append(comment_token("", start_mark)) + c[1].append(comment_token("", start_mark)) # type: ignore else: for com in before.split('\n'): - c[1].append(comment_token(com, start_mark)) + c[1].append(comment_token(com, start_mark)) # type: ignore if after: start_mark = CommentMark(after_indent) if c[3] is None: @@ -74,7 +74,7 @@ class Indents: return False def seq_flow_align(self, seq_indent, column, pre_comment=False): - # type: (int, int) -> int + # type: (int, int, Optional[bool]) -> int # extra spaces because of dash nprint('seq_flow_align', self.values, pre_comment) if len(self.values) < 2 or not self.values[-1][1]: @@ -82,10 +82,10 @@ class Indents: return 0 base = self.values[-1][0] if self.values[-1][0] is not None else 0 if pre_comment: - return base + seq_indent + return base + seq_indent # type: ignore # return (len(self.values)) * seq_indent # -1 for the dash - return base + seq_indent - column - 1 + return base + seq_indent - column - 1 # type: ignore def __len__(self): # type: () -> int @@ -498,7 +498,7 @@ class Emitter: # Flow sequence handlers. def expect_flow_sequence(self, force_flow_indent=False): - # type: (bool) -> None + # type: (Optional[bool]) -> None if force_flow_indent: self.increase_indent(flow=True, sequence=True) ind = self.indents.seq_flow_align(self.best_sequence_indent, self.column, @@ -554,7 +554,7 @@ class Emitter: # Flow mapping handlers. def expect_flow_mapping(self, single=False, force_flow_indent=False): - # type: (Optional[bool]) -> None + # type: (Optional[bool], Optional[bool]) -> None if force_flow_indent: self.increase_indent(flow=True, sequence=False) ind = self.indents.seq_flow_align(self.best_sequence_indent, self.column, diff --git a/representer.py b/representer.py index f0aea0a..820559b 100644 --- a/representer.py +++ b/representer.py @@ -1082,6 +1082,7 @@ class RoundTripRepresenter(SafeRepresenter): return SafeRepresenter.represent_bool(self, data, anchor=anchor) def represent_yaml_object(self, tag, data, cls, flow_style=None): + # type: (Any, Any, Any, Optional[Any]) -> Any if hasattr(data, '__getstate__'): state = data.__getstate__() else: @@ -67,6 +67,7 @@ timestamp_regexp = RegExp( def create_timestamp( year, month, day, t, hour, minute, second, fraction, tz, tz_sign, tz_hour, tz_minute ): + # type: (Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any) -> Any year = int(year) month = int(month) day = int(day) |