Skip to content

Commit 525c1cc

Browse files
committed
more linting fixes
1 parent f615403 commit 525c1cc

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ eggs/
1616
*.egg
1717
.tox/
1818
.pytest_cache
19+
*.so
1920

2021
# Editor Temps
2122
.*.sw?

cwltool/cwlprov/ro.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@
4747
WORKFLOW,
4848
Hasher,
4949
)
50+
5051
if TYPE_CHECKING:
51-
from .provenance_profile import ProvenanceProfile
52+
from .provenance_profile import ProvenanceProfile # pylint: disable=unused-import
5253

5354

5455
class ResearchObject:
@@ -95,7 +96,13 @@ def initialize_provenance(
9596
fsaccess: StdFsAccess,
9697
run_uuid: Optional[uuid.UUID] = None,
9798
) -> "ProvenanceProfile":
98-
"""Provide a provenance profile initialization hook function to extend details as needed."""
99+
"""
100+
Provide a provenance profile initialization hook function.
101+
102+
Allows overriding the default strategy to define the
103+
provenance profile concepts and associations to extend
104+
details as needed.
105+
"""
99106
from .provenance_profile import ProvenanceProfile
100107

101108
return ProvenanceProfile(
@@ -144,7 +151,15 @@ def _initialize_bagit(self) -> None:
144151
bag_it_file.write(f"Tag-File-Character-Encoding: {ENCODING}\n")
145152

146153
def resolve_user(self) -> tuple[str, str]:
147-
"""Provide a user provenance hook function in case the calling code can provide a better resolution."""
154+
"""
155+
Provide a user provenance hook function.
156+
157+
Allows overriding the default strategy to retrieve user provenance
158+
in case the calling code can provide a better resolution.
159+
The function must return a tuple of the (username, fullname)
160+
that identifies the user. This user will be applied on top
161+
to any provided ORCID or fullname by agent association.
162+
"""
148163
return _whoami()
149164

150165
def user_provenance(self, document: ProvDocument) -> None:
@@ -187,7 +202,13 @@ def user_provenance(self, document: ProvDocument) -> None:
187202
document.actedOnBehalfOf(account, user)
188203

189204
def resolve_host(self) -> tuple[str, str]:
190-
"""Provide a host provenance hook function in case the calling code can provide a better resolution."""
205+
"""
206+
Provide a host provenance hook function.
207+
208+
Allows overriding the default strategy to retrieve host provenance
209+
in case the calling code can provide a better resolution.
210+
The function must return a tuple of the (fqdn, uri) that identifies the host.
211+
"""
191212
fqdn = getfqdn()
192213
return fqdn, fqdn # allow for (fqdn, uri) to be distinct, but the same by default
193214

cwltool/executors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from .command_line_tool import CallbackJob, ExpressionJob
2020
from .context import RuntimeContext, getdefault
2121
from .cuda import cuda_version_and_device_count
22-
from .cwlprov.provenance_profile import ProvenanceProfile
2322
from .errors import WorkflowException
2423
from .job import JobBase
2524
from .loghandler import _logger

0 commit comments

Comments
 (0)