Skip to content

Commit

Permalink
Add wdl-conformance-tests to gitignore and sphinx config + remove uns…
Browse files Browse the repository at this point in the history
…ued imports in job + get rid of wdl dependency in job.py
  • Loading branch information
stxue1 committed Nov 14, 2024
1 parent f12c199 commit 645fd25
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ venv*
v3nv/
tmp/
/src/toil/test/cwl/spec*
/src/toil/test/wdl/wdl-conformance-tests
/cwltool_deps/
/docs/generated_rst/
/docker/Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def setup(app):
autoapi_dirs = ["../src/toil"]
autodoc_typehints = "description"
autoapi_keep_files = True
autoapi_ignore = ["*.pyi", "*/test/cwl/spec*/*.py", "*/fake_mpi_run.py", "*/tutorial_*.py", "*/example_*.py", "*/mkFile.py", "*/debugWorkflow.py"]
autoapi_ignore = ["*.pyi", "*/test/cwl/spec*/*.py", "*/fake_mpi_run.py", "*/tutorial_*.py", "*/example_*.py", "*/mkFile.py", "*/debugWorkflow.py",
"*/test/wdl/wdl-conformance-tests/*"]
autoapi_options = [
"members",
"undoc-members",
Expand Down
21 changes: 10 additions & 11 deletions src/toil/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@
NamedTuple,
Optional,
Sequence,
Set,
Tuple,
TypeVar,
Union,
cast,
overload, TypedDict, Literal,
overload,
TypedDict,
Literal,
)
from urllib.error import HTTPError
from urllib.parse import urlsplit, unquote, urljoin

from configargparse import ArgParser

from toil import memoize
from toil.bus import Names
from toil.lib.compatibility import deprecated

import dill
from configargparse import ArgParser
Expand All @@ -81,11 +78,13 @@
from optparse import OptionParser

from toil.batchSystems.abstractBatchSystem import (
BatchJobExitReason,
InsufficientSystemResources,
BatchJobExitReason
)
from toil.fileStores.abstractFileStore import AbstractFileStore
from toil.jobStores.abstractJobStore import AbstractJobStore, UnimplementedURLException
from toil.jobStores.abstractJobStore import (
AbstractJobStore,
UnimplementedURLException,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -3793,7 +3792,7 @@ class FileMetadata(NamedTuple):
def potential_absolute_uris(
uri: str,
path: list[str],
importer: WDL.Tree.Document | None = None,
importer: str | None = None,
execution_dir: str | None = None,
) -> Iterator[str]:
"""
Expand Down Expand Up @@ -3834,7 +3833,7 @@ def potential_absolute_uris(

if importer is not None:
# Add the place the imported file came form, to search first.
full_path_list.append(Toil.normalize_uri(importer.pos.abspath))
full_path_list.append(Toil.normalize_uri(importer))

# Then the current directory. We need to make sure to include a filename component here or it will treat the current directory with no trailing / as a document and relative paths will look 1 level up.
# When importing on a worker, the cwd will be a tmpdir and will result in FileNotFoundError after os.path.abspath, so override with the execution dir
Expand Down
2 changes: 1 addition & 1 deletion src/toil/wdl/wdltoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ async def toil_read_source(
# We track our own failures for debugging
tried = []

for candidate_uri in potential_absolute_uris(uri, path, importer):
for candidate_uri in potential_absolute_uris(uri, path, importer=importer.pos.abspath if importer else None):
# For each place to try in order
destination_buffer = io.BytesIO()
logger.debug("Fetching %s", candidate_uri)
Expand Down

0 comments on commit 645fd25

Please sign in to comment.