-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Factory: also parse command-line options #2060
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2060 +/- ##
==========================================
- Coverage 83.99% 83.97% -0.02%
==========================================
Files 46 46
Lines 8302 8332 +30
Branches 1957 1964 +7
==========================================
+ Hits 6973 6997 +24
- Misses 853 858 +5
- Partials 476 477 +1 ☔ View full report in Codecov by Sentry. |
cwltool/factory.py
Outdated
self.runtime_context.find_default_container = functools.partial( | ||
find_default_container, default_container=None, use_biocontainers=None | ||
) | ||
|
||
if sys.platform == "darwin": | ||
default_mac_path = "/private/tmp/docker_tmp" | ||
if self.runtimeContext.tmp_outdir_prefix == DEFAULT_TMP_PREFIX: | ||
self.runtimeContext.tmp_outdir_prefix = default_mac_path | ||
|
||
for dirprefix in ("tmpdir_prefix", "tmp_outdir_prefix", "cachedir"): | ||
if ( | ||
getattr(self.runtime_context, dirprefix) | ||
and getattr(self.runtime_context, dirprefix) != DEFAULT_TMP_PREFIX | ||
): | ||
sl = ( | ||
"/" | ||
if getattr(self.runtime_context, dirprefix).endswith("/") | ||
or dirprefix == "cachedir" | ||
else "" | ||
) | ||
setattr( | ||
self.runtime_context, | ||
dirprefix, | ||
os.path.abspath(getattr(self.runtime_context, dirprefix)) + sl, | ||
) | ||
if not os.path.exists(os.path.dirname(getattr(self.runtime_context, dirprefix))): | ||
try: | ||
os.makedirs(os.path.dirname(getattr(self.runtime_context, dirprefix))) | ||
except Exception as e: | ||
print("Failed to create directory: %s", e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo, refactor this and the equivalent code from cwltool/main.py
to a shared function. May need to look back to
Line 748 in b0db43e
if sys.platform == "darwin": |
Co-authored-by: Michael R. Crusoe <[email protected]>
Re-do of #1099