|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import sys |
2 | 4 | from pathlib import Path |
3 | | -from typing import Optional, List, Dict, Any |
| 5 | +from typing import Any, Dict, List, Optional |
4 | 6 |
|
5 | 7 | from typeguard import check_argument_types |
6 | 8 |
|
7 | 9 | from psij.job_attributes import JobAttributes |
8 | 10 | from psij.resource_spec import ResourceSpec |
9 | | - |
10 | 11 | from psij.utils import path_object_to_full_path as o2p |
11 | 12 |
|
12 | 13 |
|
13 | 14 | class JobSpec(object): |
14 | 15 | """A class to hold information about the characteristics of a:class:`~psij.Job`.""" |
15 | 16 |
|
16 | 17 | def __init__(self, name: Optional[str] = None, executable: Optional[str] = None, |
17 | | - arguments: Optional[List[str]] = None, directory: Optional[Path] = None, |
| 18 | + arguments: Optional[List[str]] = None, directory: Optional[str | Path] = None, |
18 | 19 | inherit_environment: bool = True, environment: Optional[Dict[str, str]] = None, |
19 | | - stdin_path: Optional[Path] = None, stdout_path: Optional[Path] = None, |
20 | | - stderr_path: Optional[Path] = None, resources: Optional[ResourceSpec] = None, |
21 | | - attributes: Optional[JobAttributes] = None, pre_launch: Optional[Path] = None, |
22 | | - post_launch: Optional[Path] = None, launcher: Optional[str] = None): |
| 20 | + stdin_path: Optional[str | Path] = None, stdout_path: Optional[str | Path] = None, |
| 21 | + stderr_path: Optional[str | Path] = None, resources: Optional[ResourceSpec] = None, |
| 22 | + attributes: Optional[JobAttributes] = None, pre_launch: Optional[str | Path] = None, |
| 23 | + post_launch: Optional[str | Path] = None, launcher: Optional[str] = None): |
23 | 24 | """ |
24 | 25 | Constructs a `JobSpec` object while allowing its properties to be initialized. |
25 | 26 |
|
|
0 commit comments