summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-12-26 16:05:10 +0100
committerAnthon van der Neut <anthon@mnt.org>2021-12-26 16:05:10 +0100
commite3439a8768e067134385cb2ad4746e9dcbcb851a (patch)
tree198b6de9ae5ffe1c7baa10f660add34354c76eab
parent1dd3366f57e1feff1aa2aeb01142b63520bac0a1 (diff)
downloadruamel.yaml-e3439a8768e067134385cb2ad4746e9dcbcb851a.tar.gz
fix mypy issues emitter.py0.17.19
-rw-r--r--CHANGES3
-rw-r--r--README.rst11
-rw-r--r--__init__.py6
-rw-r--r--_doc/_static/pypi.svg2
-rw-r--r--comments.py4
-rw-r--r--emitter.py10
-rw-r--r--representer.py1
-rw-r--r--util.py1
8 files changed, 23 insertions, 15 deletions
diff --git a/CHANGES b/CHANGES
index ec981e8..2be1fe5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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/>`__)
diff --git a/README.rst b/README.rst
index 35a0129..0e85970 100644
--- a/README.rst
+++ b/README.rst
@@ -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:
diff --git a/emitter.py b/emitter.py
index b66cffa..06de29c 100644
--- a/emitter.py
+++ b/emitter.py
@@ -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:
diff --git a/util.py b/util.py
index c2ab46f..f3a96a1 100644
--- a/util.py
+++ b/util.py
@@ -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)