diff --git a/cwltool/cwlviewer.py b/cwltool/cwlviewer.py index 40527fa2a..d259f278c 100644 --- a/cwltool/cwlviewer.py +++ b/cwltool/cwlviewer.py @@ -157,7 +157,7 @@ def _set_output_edges(self) -> None: pydot.Edge(output_edge_row["step"], output_edge_row["output"]) ) - def _get_root_graph_uri(self) -> rdflib.URIRef: + def _get_root_graph_uri(self) -> rdflib.term.Identifier: with open(_get_root_query_path) as f: get_root_query = f.read() root = cast( @@ -173,7 +173,7 @@ def _get_root_graph_uri(self) -> rdflib.URIRef: "Cannot identify root workflow! Notice that only Workflows can be visualized" ) - workflow = root[0]["workflow"] # type: rdflib.URIRef + workflow = root[0]["workflow"] return workflow @classmethod diff --git a/mypy-stubs/rdflib/container.pyi b/mypy-stubs/rdflib/container.pyi deleted file mode 100644 index ff5562828..000000000 --- a/mypy-stubs/rdflib/container.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Any - -class Container: - graph: Any - uri: Any - def __init__(self, graph, uri, seq=..., rtype: str = ...) -> None: ... - def n3(self): ... - def __len__(self): ... - def type_of_conatiner(self): ... - def index(self, item): ... - def __getitem__(self, key): ... - def __setitem__(self, key, value) -> None: ... - def __delitem__(self, key) -> None: ... - def items(self): ... - def end(self): ... - def append(self, item): ... - def append_multiple(self, other): ... - def clear(self): ... - -class Bag(Container): - def __init__(self, graph, uri, seq=...) -> None: ... - -class Alt(Container): - def __init__(self, graph, uri, seq=...) -> None: ... - def anyone(self): ... - -class Seq(Container): - def __init__(self, graph, uri, seq=...) -> None: ... - def add_at_position(self, pos, item): ... - -class NoElementException(Exception): - message: Any - def __init__(self, message: str = ...) -> None: ... diff --git a/mypy-stubs/rdflib/events.pyi b/mypy-stubs/rdflib/events.pyi deleted file mode 100644 index 6551a8880..000000000 --- a/mypy-stubs/rdflib/events.pyi +++ /dev/null @@ -1,8 +0,0 @@ -class Event: - def __init__(self, **kw) -> None: ... - -class Dispatcher: - def set_map(self, amap): ... - def get_map(self): ... - def subscribe(self, event_type, handler): ... - def dispatch(self, event) -> None: ... diff --git a/mypy-stubs/rdflib/exceptions.pyi b/mypy-stubs/rdflib/exceptions.pyi deleted file mode 100644 index 06366c971..000000000 --- a/mypy-stubs/rdflib/exceptions.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Any - -class Error(Exception): - msg: Any - def __init__(self, msg: Any | None = ...) -> None: ... - -class TypeCheckError(Error): - type: Any - node: Any - def __init__(self, node: Any) -> None: ... - -class SubjectTypeError(TypeCheckError): - msg: Any - def __init__(self, node: Any) -> None: ... - -class PredicateTypeError(TypeCheckError): - msg: Any - def __init__(self, node: Any) -> None: ... - -class ObjectTypeError(TypeCheckError): - msg: Any - def __init__(self, node: Any) -> None: ... - -class ContextTypeError(TypeCheckError): - msg: Any - def __init__(self, node: Any) -> None: ... - -class ParserError(Error): - msg: Any - def __init__(self, msg: Any) -> None: ... - -class UniquenessError(Error): - def __init__(self, values: Any) -> None: ... diff --git a/mypy-stubs/rdflib/paths.pyi b/mypy-stubs/rdflib/paths.pyi index de350b131..9bea17956 100644 --- a/mypy-stubs/rdflib/paths.pyi +++ b/mypy-stubs/rdflib/paths.pyi @@ -15,12 +15,7 @@ class Path: __truediv__: Callable[[Path, Union["URIRef", "Path"]], "SequencePath"] __mul__: Callable[[Path, str], "MulPath"] def __hash__(self) -> int: ... - def __eq__(self, other: Any) -> bool: ... def __lt__(self, other: Any) -> bool: ... - def __le__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... - def __gt__(self, other: Any) -> bool: ... - def __ge__(self, other: Any) -> bool: ... class InvPath(Path): ... class SequencePath(Path): ... diff --git a/mypy-stubs/rdflib/plugins/parsers/notation3.pyi b/mypy-stubs/rdflib/plugins/parsers/notation3.pyi index e022eda40..40932a787 100644 --- a/mypy-stubs/rdflib/plugins/parsers/notation3.pyi +++ b/mypy-stubs/rdflib/plugins/parsers/notation3.pyi @@ -1,11 +1 @@ -# Stubs for rdflib.plugins.parsers.notation3 (Python 3.5) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class BadSyntax(SyntaxError): - lines = ... # type: Any - def __init__(self, uri: Any, lines: Any, argstr: Any, i: Any, why: Any): ... - @property - def message(self) -> Any: ... +class BadSyntax(SyntaxError): ... diff --git a/mypy-stubs/rdflib/query.pyi b/mypy-stubs/rdflib/query.pyi index db0d89290..73f4008b3 100644 --- a/mypy-stubs/rdflib/query.pyi +++ b/mypy-stubs/rdflib/query.pyi @@ -1,22 +1,22 @@ -from io import BufferedIOBase -from typing import Any, Dict, Iterator, List, Optional, Tuple, overload +from typing import IO, Any, Dict, Iterator, List, Mapping, Optional, Tuple, overload from rdflib import URIRef, Variable +from rdflib.term import Identifier from typing_extensions import SupportsIndex -class ResultRow: # Tuple[Variable, URIRef]): +class ResultRow(Tuple["Identifier", ...]): def __new__( - cls, values: Dict[Variable, URIRef], labels: List[Variable] + cls, values: Mapping[Variable, Identifier], labels: List[Variable] ) -> ResultRow: ... - def __getattr__(self, name: str) -> Any: ... + def __getattr__(self, name: str) -> Identifier: ... @overload - def __getitem__(self, name: str) -> URIRef: ... + def __getitem__(self, name: str) -> Identifier: ... @overload - def __getitem__(self, __x: SupportsIndex) -> Variable | URIRef: ... + def __getitem__(self, __x: SupportsIndex) -> Identifier: ... @overload - def __getitem__(self, __x: slice) -> Tuple[Variable | URIRef, ...]: ... - def get(self, name: str, default: Any | None = ...) -> URIRef: ... - def asdict(self) -> Dict[Variable, URIRef]: ... + def __getitem__(self, __x: slice) -> Tuple[Identifier, ...]: ... + def get(self, name: str, default: Any | None = ...) -> Identifier: ... + def asdict(self) -> Dict[str, Identifier]: ... class Result: type: Any @@ -28,14 +28,14 @@ class Result: def __iter__(self) -> Iterator[bool | ResultRow]: ... @staticmethod def parse( - source: str | None = ..., + source: IO[Any] | None = ..., format: str | None = ..., content_type: str | None = ..., **kwargs: Any ) -> Result: ... def serialize( self, - destination: str | BufferedIOBase | None = ..., + destination: str | IO[Any] | None = ..., encoding: str = ..., format: str = ..., **args: Any diff --git a/mypy-stubs/rdflib/serializer.pyi b/mypy-stubs/rdflib/serializer.pyi deleted file mode 100644 index a91c6cf91..000000000 --- a/mypy-stubs/rdflib/serializer.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -class Serializer: - store: Any - encoding: str - base: Any - def __init__(self, store) -> None: ... - def serialize( - self, stream, base: Any | None = ..., encoding: Any | None = ..., **args - ) -> None: ... - def relativize(self, uri): ... diff --git a/mypy-stubs/rdflib/store.pyi b/mypy-stubs/rdflib/store.pyi deleted file mode 100644 index fd6b3eda9..000000000 --- a/mypy-stubs/rdflib/store.pyi +++ /dev/null @@ -1,53 +0,0 @@ -import pickle -from typing import Any - -from rdflib.events import Event - -Pickler = pickle.Pickler -Unpickler = pickle.Unpickler -UnpicklingError = pickle.UnpicklingError - -class StoreCreatedEvent(Event): ... -class TripleAddedEvent(Event): ... -class TripleRemovedEvent(Event): ... - -class NodePickler: - def __init__(self) -> None: ... - def register(self, object, id) -> None: ... - def loads(self, s): ... - def dumps(self, obj, protocol: Any | None = ..., bin: Any | None = ...): ... - -class Store: - context_aware: bool - formula_aware: bool - transaction_aware: bool - graph_aware: bool - dispatcher: Any - def __init__( - self, configuration: Any | None = ..., identifier: Any | None = ... - ) -> None: ... - node_pickler: Any - def create(self, configuration) -> None: ... - def open(self, configuration, create: bool = ...): ... - def close(self, commit_pending_transaction: bool = ...) -> None: ... - def destroy(self, configuration) -> None: ... - def gc(self) -> None: ... - def add(self, triple, context, quoted: bool = ...) -> None: ... - def addN(self, quads) -> None: ... - def remove(self, triple, context: Any | None = ...) -> None: ... - def triples_choices(self, triple, context: Any | None = ...) -> None: ... - def triples(self, triple_pattern, context: Any | None = ...) -> None: ... - def __len__(self, context: Any | None = ...) -> None: ... - def contexts(self, triple: Any | None = ...) -> None: ... - def query(self, query, initNs, initBindings, queryGraph, **kwargs: Any) -> None: ... - def update( - self, update, initNs, initBindings, queryGraph, **kwargs: Any - ) -> None: ... - def bind(self, prefix, namespace) -> None: ... - def prefix(self, namespace) -> None: ... - def namespace(self, prefix) -> None: ... - def namespaces(self) -> None: ... - def commit(self) -> None: ... - def rollback(self) -> None: ... - def add_graph(self, graph) -> None: ... - def remove_graph(self, graph) -> None: ... diff --git a/mypy-stubs/rdflib/term.pyi b/mypy-stubs/rdflib/term.pyi index 5b2fdd0ee..0830bdc29 100644 --- a/mypy-stubs/rdflib/term.pyi +++ b/mypy-stubs/rdflib/term.pyi @@ -7,7 +7,9 @@ class Identifier(Node, str): def eq(self, other: Any) -> bool: ... def neq(self, other: Any) -> bool: ... -class URIRef(Identifier): +class IdentifiedNode(Identifier): ... + +class URIRef(IdentifiedNode): def toPython(self) -> str: ... def n3(self, namespace_manager: Any | None = ...) -> str: ... def defrag(self) -> "URIRef": ... @@ -16,7 +18,7 @@ class URIRef(Identifier): class Genid(URIRef): ... class RDFLibGenid(Genid): ... -class BNode(Identifier): +class BNode(IdentifiedNode): def toPython(self) -> str: ... def n3(self, namespace_manager: Any | None = ...) -> str: ... def skolemize( @@ -36,14 +38,6 @@ class Literal(Identifier): def n3(self, namespace_manager: Any | None = ...) -> str: ... def toPython(self) -> str: ... -def bind( - datatype: str | None, - pythontype: type, - constructor: Callable[..., Any] | None = ..., - lexicalizer: Callable[..., Any] | None = ..., - datatype_specific: bool = ..., -) -> None: ... - class Variable(Identifier): def toPython(self) -> str: ... def n3(self, namespace_manager: Any | None = ...) -> str: ... diff --git a/mypy-stubs/rdflib/util.pyi b/mypy-stubs/rdflib/util.pyi deleted file mode 100644 index 5e6ef56c3..000000000 --- a/mypy-stubs/rdflib/util.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from typing import Any - -def list2set(seq): ... -def first(seq): ... -def uniq(sequence, strip: int = ...): ... -def more_than(sequence, number): ... -def to_term(s, default: Any | None = ...): ... -def from_n3( - s: str, default: Any | None = ..., backend: Any | None = ..., nsm: Any | None = ... -): ... -def check_context(c) -> None: ... -def check_subject(s) -> None: ... -def check_predicate(p) -> None: ... -def check_object(o) -> None: ... -def check_statement(triple) -> None: ... -def check_pattern(triple) -> None: ... -def date_time(t: Any | None = ..., local_time_zone: bool = ...): ... -def parse_date_time(val): ... -def guess_format(fpath, fmap: Any | None = ...): ... -def find_roots(graph, prop, roots: Any | None = ...): ... -def get_tree( - graph, - root, - prop, - mapper=..., - sortkey: Any | None = ..., - done: Any | None = ..., - dir: str = ..., -): ...