Skip to content

allow mypy process type to be used as by interpreted subclasses #1746

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

Merged
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
2 changes: 2 additions & 0 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
)

from cwl_utils import expression
from mypy_extensions import mypyc_attr
from pkg_resources import resource_stream
from rdflib import Graph
from ruamel.yaml.comments import CommentedMap, CommentedSeq
Expand Down Expand Up @@ -535,6 +536,7 @@ def eval_resource(
FILE_COUNT_WARNING = 5000


@mypyc_attr(allow_interpreted_subclasses=True)
class Process(HasReqsHints, metaclass=abc.ABCMeta):
def __init__(
self, toolpath_object: CommentedMap, loadingContext: LoadingContext
Expand Down
3 changes: 2 additions & 1 deletion cwltool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import requests
from cachecontrol import CacheControl
from cachecontrol.caches import FileCache
from mypy_extensions import TypedDict
from mypy_extensions import TypedDict, mypyc_attr
from schema_salad.exceptions import ValidationException
from schema_salad.ref_resolver import Loader
from typing_extensions import TYPE_CHECKING, Deque
Expand Down Expand Up @@ -502,6 +502,7 @@ def create_tmp_dir(tmpdir_prefix: str) -> str:
return tempfile.mkdtemp(prefix=tmp_prefix, dir=tmp_dir)


@mypyc_attr(allow_interpreted_subclasses=True)
class HasReqsHints:
"""Base class for get_requirement()."""

Expand Down