Skip to content

Commit 7b71573

Browse files
authored
Update black and reformat all. (#388)
This should get rid of test failures.
2 parents 9313aba + 1a384a4 commit 7b71573

File tree

10 files changed

+21
-14
lines changed

10 files changed

+21
-14
lines changed

papyri/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
164164
"""
165165

166-
167166
import io
168167
import sys
169168
import zipfile

papyri/browser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
papyri browser
33
"""
4+
45
import sys
56
from typing import List
67

papyri/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
It should likely be the modules with the less dependencies as well as being synchronous, to be usable from most context
88
and minimal installs.
99
"""
10+
1011
from __future__ import annotations
1112

1213
import json

papyri/miniserde.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
6565
"""
6666

67-
6867
from functools import lru_cache
6968
from typing import Union
7069
from typing import get_type_hints as gth

papyri/myst_ast.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
An attempt to create AST from MyST spec.
33
"""
4+
45
from typing import List, Union, Optional, Dict
56

67
from .common_ast import Node, register
@@ -310,7 +311,7 @@ class MRoot(Node):
310311
"take2.DefList",
311312
"take2.DefListItem",
312313
"take2.FieldList",
313-
MComment # this seem not right but triggers an error with numpy narrative documentation
314+
MComment, # this seem not right but triggers an error with numpy narrative documentation
314315
# MTable,
315316
# MFootnoteDefinition,
316317
]

papyri/myst_serialiser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
This is a prototype of serializer that respect this layout.
1111
"""
1212

13-
1413
from typing import Union
1514
from typing import get_type_hints as gth
1615

papyri/signature.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ def to_parameter(self) -> inspect.Parameter:
3838
name=self.name,
3939
kind=getattr(inspect._ParameterKind, self.kind),
4040
default=inspect._empty if isinstance(self.default, Empty) else self.default,
41-
annotation=inspect._empty
42-
if isinstance(self.annotation, Empty)
43-
else self.annotation,
41+
annotation=(
42+
inspect._empty
43+
if isinstance(self.annotation, Empty)
44+
else self.annotation
45+
),
4446
)
4547

4648

@@ -132,18 +134,22 @@ def to_node(self) -> SignatureNode:
132134
name=param.name,
133135
annotation=annotation,
134136
kind=param.kind.name,
135-
default=_empty
136-
if param.default is inspect._empty
137-
else clean_hexaddress(str(param.default)),
137+
default=(
138+
_empty
139+
if param.default is inspect._empty
140+
else clean_hexaddress(str(param.default))
141+
),
138142
)
139143
)
140144
assert isinstance(kind, str)
141145
return SignatureNode(
142146
kind=kind,
143147
parameters=parameters,
144-
return_annotation=_empty
145-
if self._sig.return_annotation is inspect._empty
146-
else str(self._sig.return_annotation),
148+
return_annotation=(
149+
_empty
150+
if self._sig.return_annotation is inspect._empty
151+
else str(self._sig.return_annotation)
152+
),
147153
target_name=self.target_item.__name__,
148154
)
149155

papyri/tests/test_signatures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This file is meant to test the serialisation / deserialization
33
of function signature to JSON.
44
"""
5+
56
from papyri.signature import Signature as SignatureObject, SignatureNode
67
import json
78
from typing import Union, Optional

papyri/textual.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
papyri textual
33
"""
4+
45
from pathlib import Path
56

67
from textual.app import App, ComposeResult, RenderResult

papyri/vref.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
vestigial things from velin.
33
"""
44

5-
65
import numpydoc.docscrape as nds
76

87

0 commit comments

Comments
 (0)