Skip to content
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
19 changes: 13 additions & 6 deletions src/workflowpy/_typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Tuple, Union
Expand Down Expand Up @@ -109,6 +110,18 @@ class filedirpath(Path):
...


class outputdirpath(Path):
"""Subclass Path to indicate Param is used as root for output locations."""

...


# Python 3.11 compat
if sys.version_info[0] == 3 and sys.version_info[1] <= 11:
setattr(filedirpath, "_flavour", type(Path())._flavour)
setattr(outputdirpath, "_flavour", type(Path())._flavour)


def filedir_validator(x: Path) -> filedirpath:
"""Promote Path to filedirpath type."""
return filedirpath(x)
Expand All @@ -117,12 +130,6 @@ def filedir_validator(x: Path) -> filedirpath:
FileDirPath = Annotated[Path, AfterValidator(filedir_validator)]


class outputdirpath(Path):
"""Subclass Path to indicate Param is used as root for output locations."""

...


def outputdirpath_validator(x: Path) -> outputdirpath:
"""Promote Path to outputdirpath."""
return outputdirpath(x)
Expand Down
4 changes: 2 additions & 2 deletions src/workflowpy/workflow/entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

__all__ = ["METHODS"]

__eps__ = {}
__eps__ = {} # This is more or less pro forma


class MethodEPS:
Expand All @@ -19,7 +19,7 @@ class MethodEPS:
load local methods lazily. Methods are loaded by name or class name.
"""

group: ClassVar[str] = ""
group: ClassVar[str] = "workflowpy"

def __init__(self, eps: Optional[Dict[str, Union[str, EntryPoint]]] = None) -> None:
"""Initialize."""
Expand Down
Loading