Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update black and reformat all. #388

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion papyri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@

"""


import io
import sys
import zipfile
Expand Down
1 change: 1 addition & 0 deletions papyri/browser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
papyri browser
"""

import sys
from typing import List

Expand Down
1 change: 1 addition & 0 deletions papyri/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
It should likely be the modules with the less dependencies as well as being synchronous, to be usable from most context
and minimal installs.
"""

from __future__ import annotations

import json
Expand Down
1 change: 0 additions & 1 deletion papyri/miniserde.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@

"""


from functools import lru_cache
from typing import Union
from typing import get_type_hints as gth
Expand Down
3 changes: 2 additions & 1 deletion papyri/myst_ast.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
An attempt to create AST from MyST spec.
"""

from typing import List, Union, Optional, Dict

from .common_ast import Node, register
Expand Down Expand Up @@ -310,7 +311,7 @@ class MRoot(Node):
"take2.DefList",
"take2.DefListItem",
"take2.FieldList",
MComment # this seem not right but triggers an error with numpy narrative documentation
MComment, # this seem not right but triggers an error with numpy narrative documentation
# MTable,
# MFootnoteDefinition,
]
Expand Down
1 change: 0 additions & 1 deletion papyri/myst_serialiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
This is a prototype of serializer that respect this layout.
"""


from typing import Union
from typing import get_type_hints as gth

Expand Down
24 changes: 15 additions & 9 deletions papyri/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ def to_parameter(self) -> inspect.Parameter:
name=self.name,
kind=getattr(inspect._ParameterKind, self.kind),
default=inspect._empty if isinstance(self.default, Empty) else self.default,
annotation=inspect._empty
if isinstance(self.annotation, Empty)
else self.annotation,
annotation=(
inspect._empty
if isinstance(self.annotation, Empty)
else self.annotation
),
)


Expand Down Expand Up @@ -132,18 +134,22 @@ def to_node(self) -> SignatureNode:
name=param.name,
annotation=annotation,
kind=param.kind.name,
default=_empty
if param.default is inspect._empty
else clean_hexaddress(str(param.default)),
default=(
_empty
if param.default is inspect._empty
else clean_hexaddress(str(param.default))
),
)
)
assert isinstance(kind, str)
return SignatureNode(
kind=kind,
parameters=parameters,
return_annotation=_empty
if self._sig.return_annotation is inspect._empty
else str(self._sig.return_annotation),
return_annotation=(
_empty
if self._sig.return_annotation is inspect._empty
else str(self._sig.return_annotation)
),
target_name=self.target_item.__name__,
)

Expand Down
1 change: 1 addition & 0 deletions papyri/tests/test_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This file is meant to test the serialisation / deserialization
of function signature to JSON.
"""

from papyri.signature import Signature as SignatureObject, SignatureNode
import json
from typing import Union, Optional
Expand Down
1 change: 1 addition & 0 deletions papyri/textual.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
papyri textual
"""

from pathlib import Path

from textual.app import App, ComposeResult, RenderResult
Expand Down
1 change: 0 additions & 1 deletion papyri/vref.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
vestigial things from velin.
"""


import numpydoc.docscrape as nds


Expand Down
Loading