From 3648af0f8ce409818f1d71ea25859c69a7e14b12 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Mon, 26 Jun 2017 21:32:09 +0200 Subject: [PATCH 1/3] uncomment yaml imports --- third_party/2and3/yaml/__init__.pyi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/third_party/2and3/yaml/__init__.pyi b/third_party/2and3/yaml/__init__.pyi index cecd3e896a66..f8c84beac55e 100644 --- a/third_party/2and3/yaml/__init__.pyi +++ b/third_party/2and3/yaml/__init__.pyi @@ -1,10 +1,10 @@ from typing import Any -# from yaml.error import * -# from yaml.tokens import * -# from yaml.events import * -# from yaml.nodes import * -# from yaml.loader import * -# from yaml.dumper import * +from yaml.error import * +from yaml.tokens import * +from yaml.events import * +from yaml.nodes import * +from yaml.loader import * +from yaml.dumper import * # TODO: stubs for cyaml? # from cyaml import * From eba7a68d7375c261c82312b81b9b9e5c685ee826 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Tue, 27 Jun 2017 00:13:35 +0200 Subject: [PATCH 2/3] yaml: decorate classmethods --- third_party/2and3/yaml/constructor.pyi | 2 ++ third_party/2and3/yaml/representer.pyi | 2 ++ third_party/2and3/yaml/resolver.pyi | 2 ++ 3 files changed, 6 insertions(+) diff --git a/third_party/2and3/yaml/constructor.pyi b/third_party/2and3/yaml/constructor.pyi index 1a6bf9b6ab95..40e9ea2f859c 100644 --- a/third_party/2and3/yaml/constructor.pyi +++ b/third_party/2and3/yaml/constructor.pyi @@ -22,7 +22,9 @@ class BaseConstructor: def construct_sequence(self, node, deep=...): ... def construct_mapping(self, node, deep=...): ... def construct_pairs(self, node, deep=...): ... + @classmethod def add_constructor(cls, tag, constructor): ... + @classmethod def add_multi_constructor(cls, tag_prefix, multi_constructor): ... class SafeConstructor(BaseConstructor): diff --git a/third_party/2and3/yaml/representer.pyi b/third_party/2and3/yaml/representer.pyi index 425c0988b624..b10f36de7e08 100644 --- a/third_party/2and3/yaml/representer.pyi +++ b/third_party/2and3/yaml/representer.pyi @@ -15,7 +15,9 @@ class BaseRepresenter: def represent(self, data): ... def get_classobj_bases(self, cls): ... def represent_data(self, data): ... + @classmethod def add_representer(cls, data_type, representer): ... + @classmethod def add_multi_representer(cls, data_type, representer): ... def represent_scalar(self, tag, value, style=...): ... def represent_sequence(self, tag, sequence, flow_style=...): ... diff --git a/third_party/2and3/yaml/resolver.pyi b/third_party/2and3/yaml/resolver.pyi index 2542db7e9127..0b5641e20ec6 100644 --- a/third_party/2and3/yaml/resolver.pyi +++ b/third_party/2and3/yaml/resolver.pyi @@ -12,7 +12,9 @@ class BaseResolver: resolver_exact_paths = ... # type: Any resolver_prefix_paths = ... # type: Any def __init__(self) -> None: ... + @classmethod def add_implicit_resolver(cls, tag, regexp, first): ... + @classmethod def add_path_resolver(cls, tag, path, kind=...): ... def descend_resolver(self, current_node, current_index): ... def ascend_resolver(self): ... From d7c82896e170ed36df36170d903cc9c0eb04d1e4 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Sat, 1 Jul 2017 00:25:54 +0200 Subject: [PATCH 3/3] pyyaml: ignore f403 on wildcard imports --- third_party/2and3/yaml/__init__.pyi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/third_party/2and3/yaml/__init__.pyi b/third_party/2and3/yaml/__init__.pyi index f8c84beac55e..8f2edec5804f 100644 --- a/third_party/2and3/yaml/__init__.pyi +++ b/third_party/2and3/yaml/__init__.pyi @@ -1,10 +1,10 @@ from typing import Any -from yaml.error import * -from yaml.tokens import * -from yaml.events import * -from yaml.nodes import * -from yaml.loader import * -from yaml.dumper import * +from yaml.error import * # noqa: F403 +from yaml.tokens import * # noqa: F403 +from yaml.events import * # noqa: F403 +from yaml.nodes import * # noqa: F403 +from yaml.loader import * # noqa: F403 +from yaml.dumper import * # noqa: F403 # TODO: stubs for cyaml? # from cyaml import *