Skip to content

Commit 3c4da96

Browse files
author
Sylvain MARIE
committed
Flake8 improvements
1 parent 5ea95e1 commit 3c4da96

4 files changed

Lines changed: 28 additions & 8 deletions

File tree

yamlable/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Authors: Sylvain MARIE <sylvain.marie@se.com>
2+
# + All contributors to <https://github.com/smarie/python-yamlable>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-yamlable/blob/master/LICENSE>
5+
16
from yamlable.base import AbstractYamlObject, NONE_IGNORE_CHECKS, read_yaml_node_as_dict
27
from yamlable.main import YamlCodec, register_yamlable_codec, yaml_info_decorate, yaml_info, YamlAble, \
38
AbstractYamlAble, YAMLABLE_PREFIX
@@ -26,13 +31,13 @@
2631
]
2732

2833
try: # python 3.5+
29-
from yamlable.base import Y
34+
from yamlable.base import Y # noqa: F401
3035
__all__.append('Y')
3136
except ImportError:
3237
pass
3338

3439
try: # python 3.5+
35-
from yamlable.main import YA
40+
from yamlable.main import YA # noqa: F401
3641
__all__.append('YA')
3742
except ImportError:
3843
pass

yamlable/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Authors: Sylvain MARIE <sylvain.marie@se.com>
2+
# + All contributors to <https://github.com/smarie/python-yamlable>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-yamlable/blob/master/LICENSE>
5+
16
from abc import ABCMeta
27
from collections import OrderedDict
38

@@ -32,7 +37,7 @@ def __exit__(self, exception_type, exception_value, traceback):
3237
try: # python 3.5.4+
3338
from typing import Type
3439
except ImportError:
35-
pass # normal for old versions of typing
40+
pass # normal for old versions of typing
3641

3742

3843
class AbstractYamlObject(six.with_metaclass(ABCMeta, object)):

yamlable/main.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
# Authors: Sylvain MARIE <sylvain.marie@se.com>
2+
# + All contributors to <https://github.com/smarie/python-yamlable>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-yamlable/blob/master/LICENSE>
5+
16
import collections
27
from abc import abstractmethod, ABCMeta
38

49
import six
510

611
try: # python 3.5+
7-
from typing import TypeVar, Callable, Optional, Iterable, Any, Tuple, Mapping, Any, Dict, Set, List
12+
from typing import TypeVar, Callable, Iterable, Any, Tuple, Dict, Set, List
813
YA = TypeVar('YA', bound='YamlAble')
914
T = TypeVar('T')
1015
except ImportError:
@@ -13,7 +18,7 @@
1318
try: # python 3.5.4+
1419
from typing import Type
1520
except ImportError:
16-
pass # normal for old versions of typing
21+
pass # normal for old versions of typing
1722

1823
from yaml import Loader, SafeLoader, Dumper, SafeDumper, MappingNode
1924

@@ -452,8 +457,8 @@ def encode(cls, dumper, obj,
452457
453458
:param dumper:
454459
:param obj:
455-
:param without_custom_tag: if this is set to True, the yaml tag !yamlable/<yaml_tag_suffix> will not be written to
456-
the document. Warning: if you do so, decoding the object will not be easy!
460+
:param without_custom_tag: if this is set to True, the yaml tag !yamlable/<yaml_tag_suffix> will not be written
461+
to the document. Warning: if you do so, decoding the object will not be easy!
457462
:param kwargs: keyword arguments coming from pyyaml, not sure what you will find here.
458463
:return:
459464
"""

yamlable/yaml_objects.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Authors: Sylvain MARIE <sylvain.marie@se.com>
2+
# + All contributors to <https://github.com/smarie/python-yamlable>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-yamlable/blob/master/LICENSE>
5+
16
from abc import ABCMeta
27

38
import six
@@ -11,7 +16,7 @@
1116
try: # python 3.5.4+
1217
from typing import Type
1318
except ImportError:
14-
pass # normal for old versions of typing
19+
pass # normal for old versions of typing
1520

1621
from yaml import YAMLObjectMetaclass, YAMLObject, SafeLoader, MappingNode
1722

0 commit comments

Comments
 (0)