Skip to content

Commit 6cd3b21

Browse files
committed
black: update format with 23.1.0
Fix the version of these crappy dependencies once again. Signed-off-by: Robin Jarry <robin@jarry.cc>
1 parent 484374c commit 6cd3b21

File tree

8 files changed

+9
-36
lines changed

8 files changed

+9
-36
lines changed

libyang/context.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
# -------------------------------------------------------------------------------------
2323
class Context:
24-
2524
__slots__ = ("cdata",)
2625

2726
def __init__(

libyang/data.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ def new_path(
296296
opt_bin_value: bool = False,
297297
opt_canon_value: bool = False,
298298
):
299-
300299
opt = 0
301300
if opt_update:
302301
opt |= lib.LYD_NEW_PATH_UPDATE
@@ -944,7 +943,6 @@ def value(self) -> Any:
944943

945944
@staticmethod
946945
def cdata_leaf_value(cdata, context: "libyang.Context" = None) -> Any:
947-
948946
val = lib.lyd_get_value(cdata)
949947
if val == ffi.NULL:
950948
return None

libyang/diff.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class SNodeDiff:
7878

7979
# -------------------------------------------------------------------------------------
8080
class SNodeRemoved(SNodeDiff):
81-
8281
__slots__ = ("node",)
8382

8483
def __init__(self, node: SNode):
@@ -94,7 +93,6 @@ def __str__(self):
9493

9594
# -------------------------------------------------------------------------------------
9695
class SNodeAdded(SNodeDiff):
97-
9896
__slots__ = ("node",)
9997

10098
def __init__(self, node: SNode):
@@ -106,7 +104,6 @@ def __str__(self):
106104

107105
# -------------------------------------------------------------------------------------
108106
class SNodeAttributeChanged(SNodeDiff):
109-
110107
__slots__ = ("old", "new", "value")
111108

112109
def __init__(self, old: SNode, new: SNode, value: Any = None):
@@ -289,7 +286,6 @@ class UnitsAdded(SNodeAttributeChanged):
289286

290287
# -------------------------------------------------------------------------------------
291288
def snode_changes(old: SNode, new: SNode) -> Iterator[SNodeDiff]:
292-
293289
if old.nodetype() != new.nodetype():
294290
yield NodeTypeRemoved(old, new, old.keyword())
295291
yield NodeTypeAdded(old, new, new.keyword())

libyang/schema.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import IO, Any, Dict, Iterator, Optional, Tuple, Union
77

88
from _libyang import ffi, lib
9-
from .util import IOType, c2str, init_output, ly_array_iter, str2c
9+
from .util import IOType, LibyangError, c2str, init_output, ly_array_iter, str2c
1010

1111

1212
# -------------------------------------------------------------------------------------
@@ -44,7 +44,6 @@ def printer_flags(
4444

4545
# -------------------------------------------------------------------------------------
4646
class Module:
47-
4847
__slots__ = ("context", "cdata")
4948

5049
def __init__(self, context: "libyang.Context", cdata):
@@ -228,7 +227,6 @@ def parse_data_dict(
228227

229228
# -------------------------------------------------------------------------------------
230229
class Revision:
231-
232230
__slots__ = ("context", "cdata", "module")
233231

234232
def __init__(self, context: "libyang.Context", cdata, module):
@@ -272,7 +270,6 @@ def __str__(self):
272270

273271
# -------------------------------------------------------------------------------------
274272
class Extension:
275-
276273
__slots__ = ("context", "cdata")
277274

278275
def __init__(self, context: "libyang.Context", cdata, module_parent: Module = None):
@@ -295,7 +292,6 @@ def __str__(self):
295292

296293
# -------------------------------------------------------------------------------------
297294
class ExtensionParsed(Extension):
298-
299295
__slots__ = ("module_parent",)
300296

301297
def __init__(self, context: "libyang.Context", cdata, module_parent: Module = None):
@@ -318,7 +314,6 @@ def module(self) -> Module:
318314

319315
# -------------------------------------------------------------------------------------
320316
class ExtensionCompiled(Extension):
321-
322317
__slots__ = ("cdata_def",)
323318

324319
def __init__(self, context: "libyang.Context", cdata):
@@ -336,7 +331,6 @@ def module(self) -> Module:
336331

337332
# -------------------------------------------------------------------------------------
338333
class _EnumBit:
339-
340334
__slots__ = ("context", "cdata")
341335

342336
def __init__(self, context: "libyang.Context", cdata):
@@ -388,7 +382,6 @@ class Bit(_EnumBit):
388382

389383
# -------------------------------------------------------------------------------------
390384
class Type:
391-
392385
__slots__ = ("context", "cdata", "cdata_parsed")
393386

394387
UNKNOWN = lib.LY_TYPE_UNKNOWN
@@ -609,7 +602,6 @@ def __str__(self):
609602

610603
# -------------------------------------------------------------------------------------
611604
class Feature:
612-
613605
__slots__ = ("context", "cdata")
614606

615607
def __init__(self, context: "libyang.Context", cdata):
@@ -653,7 +645,6 @@ def __str__(self):
653645

654646
# -------------------------------------------------------------------------------------
655647
class IfFeatureExpr:
656-
657648
__slots__ = ("context", "cdata", "module_features", "compiled")
658649

659650
def __init__(self, context: "libyang.Context", cdata, module_features=None):
@@ -692,7 +683,7 @@ def get_feature(name):
692683
for feature in self.module_features:
693684
if feature.name() == name:
694685
return feature.cdata
695-
raise Exception("No feature %s in module" % name)
686+
raise LibyangError("No feature %s in module" % name)
696687

697688
def parse_iffeature(tokens):
698689
def oper2(op):
@@ -789,7 +780,6 @@ def __str__(self):
789780

790781
# -------------------------------------------------------------------------------------
791782
class IfFeature(IfFeatureExprTree):
792-
793783
__slots__ = ("context", "cdata")
794784

795785
def __init__(self, context: "libyang.Context", cdata):
@@ -812,7 +802,6 @@ def __str__(self):
812802

813803
# -------------------------------------------------------------------------------------
814804
class IfNotFeature(IfFeatureExprTree):
815-
816805
__slots__ = ("context", "child")
817806

818807
def __init__(self, context: "libyang.Context", child: IfFeatureExprTree):
@@ -831,7 +820,6 @@ def __str__(self):
831820

832821
# -------------------------------------------------------------------------------------
833822
class IfAndFeatures(IfFeatureExprTree):
834-
835823
__slots__ = ("context", "a", "b")
836824

837825
def __init__(
@@ -856,7 +844,6 @@ def __str__(self):
856844

857845
# -------------------------------------------------------------------------------------
858846
class IfOrFeatures(IfFeatureExprTree):
859-
860847
__slots__ = ("context", "a", "b")
861848

862849
def __init__(
@@ -881,7 +868,6 @@ def __str__(self):
881868

882869
# -------------------------------------------------------------------------------------
883870
class SNode:
884-
885871
__slots__ = ("context", "cdata", "cdata_parsed")
886872

887873
CONTAINER = lib.LYS_CONTAINER
@@ -1076,7 +1062,6 @@ def new(context: "libyang.Context", cdata) -> "SNode":
10761062
# -------------------------------------------------------------------------------------
10771063
@SNode.register(SNode.LEAF)
10781064
class SLeaf(SNode):
1079-
10801065
__slots__ = ("cdata_leaf", "cdata_leaf_parsed")
10811066

10821067
def __init__(self, context: "libyang.Context", cdata):
@@ -1123,7 +1108,6 @@ def __str__(self):
11231108
# -------------------------------------------------------------------------------------
11241109
@SNode.register(SNode.LEAFLIST)
11251110
class SLeafList(SNode):
1126-
11271111
__slots__ = ("cdata_leaflist", "cdata_leaflist_parsed")
11281112

11291113
def __init__(self, context: "libyang.Context", cdata):
@@ -1176,7 +1160,6 @@ def __str__(self):
11761160
# -------------------------------------------------------------------------------------
11771161
@SNode.register(SNode.CONTAINER)
11781162
class SContainer(SNode):
1179-
11801163
__slots__ = ("cdata_container", "cdata_container_parsed")
11811164

11821165
def __init__(self, context: "libyang.Context", cdata):
@@ -1209,7 +1192,6 @@ def children(self, types: Optional[Tuple[int, ...]] = None) -> Iterator[SNode]:
12091192
# -------------------------------------------------------------------------------------
12101193
@SNode.register(SNode.LIST)
12111194
class SList(SNode):
1212-
12131195
__slots__ = ("cdata_list", "cdata_list_parsed")
12141196

12151197
def __init__(self, context: "libyang.Context", cdata):

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,4 @@ min-public-methods=0
525525

526526
# Exceptions that will emit a warning when being caught. Defaults to
527527
# "Exception".
528-
overgeneral-exceptions=Exception
528+
overgeneral-exceptions=builtins.Exception

tests/test_diff.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
# -------------------------------------------------------------------------------------
3030
class DiffTest(unittest.TestCase):
31-
3231
expected_diffs = frozenset(
3332
(
3433
(BaseTypeAdded, "/yolo-system:conf/speed"),

tests/test_schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ def test_iter_tree(self):
276276

277277
# -------------------------------------------------------------------------------------
278278
class ListTest(unittest.TestCase):
279-
280279
SCHEMA_PATH = "/yolo-system:conf/url"
281280
DATA_PATH = "/yolo-system:conf/url[host='%s'][proto='%s']"
282281

tox.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ basepython = python3
3232
description = Format python code using isort and black.
3333
changedir = .
3434
deps =
35-
black==22.10.0
36-
isort
35+
black~=23.1.0
36+
isort~=5.12.0
3737
skip_install = true
3838
install_command = python3 -m pip install {opts} {packages}
3939
allowlist_externals =
@@ -48,10 +48,10 @@ basepython = python3
4848
description = Run coding style checks.
4949
changedir = .
5050
deps =
51-
black==22.10.0
52-
flake8
53-
isort
54-
pylint
51+
black~=23.1.0
52+
flake8~=6.0.0
53+
isort~=5.12.0
54+
pylint~=2.16.2
5555
allowlist_externals =
5656
/bin/sh
5757
/usr/bin/sh

0 commit comments

Comments
 (0)